<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <title>&nbsp;</title>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ? MYOA_CHARSET : htmlspecialchars($HTML_PAGE_CHARSET))?>" />
    <meta name="renderer" content="ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=0.3, user-scalable=0, minimum-scale=0, maximum-scale=5.0,user-scalable=yes">    <link rel="stylesheet" type="text/css" href="../../css/workflow/m_reset.css">
    <link rel="stylesheet" type="text/css" href="../../css/workflow/work/new_work.css">
    <link rel="stylesheet" type="text/css" href="../../css/workflow/work/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../../lib/layui/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="../../css/workflow/work/handle.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/email/writeMail.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/workflow/workflow.css?20200918.1"/>

    <script type="text/javascript" src="../../js/common/language.js"></script>
    <script type="text/javascript" src="../../js/workflow/work/ProjectControl.js"></script>
    <script type="text/javascript" src="../../lib/jQuery-File-Upload-master/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/layer.js?20201106"></script>
    <script type="text/javascript" src="../../lib/laydate/laydate.js"></script>
    <script type="text/javascript" src="../../js/jquery/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../lib/jquery.form.min.js"></script>
    <script type="text/javascript" src="../../lib/jquery.jqprint-0.3.js"></script>
    <script type="text/javascript" src="../../lib/jquery-migrate-1.1.0.js"></script>
    <script type="text/javascript" src="../../js/base/base.js?20200529.2"></script>
    <script type="text/javascript" src="../../js/mustache.min.js"></script>
    <script type="text/javascript" src="../../lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="../../lib/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="../../lib/ueditor/ueditor.all.js"></script>
    <script type="text/javascript" src="../../lib/ueditor/UEcontroller.js"></script>
    <%--无主办会签问题--%>
    <script type="text/javascript" src="../../js/base/workformbase.js"></script>
    <script type="text/javascript" src="../../js/workflow/work/Loadwebsign.js?20191112.1"></script>
    <script type="text/javascript" src="../../js/workflow/work/websign_main.js?20200211.2"></script>
    <script type="text/javascript" src="../../js/workflow/work/calculateFormitem.js?20201014.2"></script>
    <script type="text/javascript" src="../../js/workflow/work/startScore.js"></script>
    <script type="text/javascript" src="../../js/workflow/work/workform.js?20210111.1"></script>
    <script type="text/javascript" src="../../lib/jquery.form.min.js"></script>
    <script type="text/javascript" src="../../lib/img2blob/js/img2blob.js?20190731.2"></script>
    <script type="text/javascript" src="../../js/workflow/work/writeSign.js?20190926.1"></script>

    <%--添加数据源JS--%>
    <script type="text/javascript" src="../../js/workflow/work/newDataControl.js"></script>

    <!-- 金格签章 -->
    <link rel="stylesheet" href="../../lib/kinggrid/dialog/artDialog/ui-dialog.css">
    <link rel="stylesheet" href="../../lib/kinggrid/core/kinggrid.plus.css">

    <script type="text/javascript" src="../../lib/kinggrid/core/kinggrid.min.js"></script>
    <script type="text/javascript" src="../../lib/kinggrid/core/kinggrid.plus.min.js"></script>
    <script type="text/javascript" src="../../lib/kinggrid/dialog/artDialog/dialog.js"></script>

    <!-- html签章核心JS -->
    <script type="text/javascript" src="../../lib/kinggrid/signature.min.js"></script>
    <!-- PC端附加功能 -->
    <script type="text/javascript" src="../../lib/kinggrid/signature.pc.min.js"></script>
    <%--<!-- 移动端端附加功能 -->--%>
    <%--<link rel="stylesheet" href="../../lib/kinggrid/core/kinggrid.plus.mobile.css">--%>
    <%--<script type="text/javascript" src="../../lib/kinggrid/signature.mobile.min.js"></script>--%>
    <!-- 手写端附加功能 -->

    <script type="text/javascript" src="../../lib/kinggrid/signature_pad.min.js"></script>
    <script type="text/javascript" src="../../lib/kinggrid/jquery.timer.dev.js"></script>

    <script type="text/javascript" src="../../js/workflow/work/macroSign.js?20191115.1" ></script>

    <!-- kindeditor文本编辑器 -->
    <script type="text/javascript" charset="utf-8" src="../../lib/kindeditor/kindeditor-all.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../lib/kindeditor/lang/zh-CN.js"></script>

    <!-- 手写签字 -->
    <script type="text/javascript" src="../../lib/jSignature-master/src/jSignature.js"></script>

    <script>
        var myBrowser = myBrowser();
        var url = location.href;
        if(myBrowser == 'IE8'&&location.href.indexOf('&ie_open=yes') > -1){
            url += '&ie_version=8';
            url= url.replace('IE=1&','').replace('&ie_open=yes','');
            location.href = url;
        }else{
            var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串,判断是否是pc客户端打开的qt浏览器
            if(userAgent.indexOf('QtWebEngine') > -1&&location.href.indexOf('&ie_open=yes') == -1&&location.href.indexOf('&tableName=document') > -1){
                url += '&ie_open=yes&IE=1';
                window.open(url);
                window.close();
            }
        }
    </script>
    <style>
        #scrollModule {
            position: fixed;
            bottom: 70px;
            right: 30px;
            width: 30px;
            height: 70px;
        }
        #scrollTop, #scrollBottom {
            cursor: pointer;
            width: 30px;
            height: 30px;
        }
        #scrollModule img {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body style="min-width: 1024px;">
<input type="hidden" value="${sessionScope.module }" id="module">
<div id="tab_c">
    <div class="tab_one">
        <iframe id='iframebar' src="about:blank" frameBorder=0 marginHeight=0 marginWidth=0 style="position:absolute; visibility:inherit; top:0px;left:0px;height:100%;width:100%; z-Index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
        <div class="one_all" id="fu">
            <ul class="cont_cone" style="position: relative">
                <li style="height:33px;line-height: 33px;position:relative;border:none;background: #f8f8f8;margin-top: 0;"><img class="fujian_logo" src="../../img/workflow/work/add_work/black1.png"><h1 class="fujian_h1" style="font-weight: bold;  font-size: 11pt;margin-top: 6px;"><fmt:message code="email.th.file" /></h1></li>
                <li id="img_none" style="background: #f8f8f8;width:100%;height:199px;text-align: center;line-height:32px;margin: 0px;border: none;"><img src="/img/workflow/work/add_work/img_nomessage_03.png" alt="" style="margin-top: 16px;">
                    <span style="display: block;color: #666;"><fmt:message code="main.th.Enclosure" /></span>
                </li>
                <div class="position backbtn"><img src="../../img/workflow/work/add_work/back.png"></div>
                <div id="oneUploadFile"></div>
            </ul>
            <div class="addFujianBox" style="position: relative;height: 15%;margin-bottom: 24px;margin-top: 24px;">
                <span style="display: inline-block;cursor: pointer;" class="add_fujian" id="add_fujian"><fmt:message code="email.th.addfile" /></span>
                <form id="uploadimgform" target="uploadiframe" action="workUpload?module=workflow"  enctype="multipart/form-data" method="post" >
                    <input type="file"  name="file" id="uploadinputimg" multiple class="w-icon5">
                    <input type="hidden" id="uprunId" name="runId">
                </form>
            </div>
        </div>
        <div class="two_all" id="hui">
            <ul class="cont_ctwo" style="position: relative">
                <li style="margin-top: 0;height:33px;border: none;background: #f8f8f8"><img class="huiqian_logo" src="../../img/workflow/work/add_work/huiqian1.png" style="height: 18px;width: 18px;margin-top: 13px;"><h1 class="huiqian_h1"><fmt:message code="workflow.th.JointlySign" /></h1></li><div class="position backbtn"><img src="../../img/workflow/work/add_work/back.png"></div>
                <li style="border: none;position: relative;margin-top: 12px;background: #f8f8f8;"><textarea id="signText" class="huiqian_inp hui_inp" style="position: absolute;height:70px;left: 56px;width: 187px!important;"></textarea>
                    <button class="huiqian_send" id="signSendBtn">提交</button><br>
                    <button style="margin-top: 9px" class="huiqian_send" id="signBtn">选择</button></li>
                <div id="signbox">
                    <li style="background: #f8f8f8;width:100%;height:199px;text-align: center;line-height:32px;margin: 0px;border: none;">
                        <img src="/img/workflow/work/add_work/img_nomessage_03.png" alt="" style="margin-top: 16px;">
                        <span style="display: block;color: #666;"> <fmt:message code="main.th.Opinion"/></span>
                    </li>
                </div>
            </ul>
        </div>

    </div>
    <div id="tab_ctwo">
        <ul class="cont_cthr" style="overflow: hidden;">
            <iframe frameborder="0" width="100%" height="100%" marginheight="0" marginwidth="0" scrolling="no" src=""></iframe>
        </ul>
        <ul class="cont_cfour" style="display: block;position: relative;">
            <li style="height:33px;line-height: 33px;position:relative;border:none;background: #f8f8f8;margin-top: 0;width:  90%;margin: 0 auto;"><img class="fujian_logo" src="../../img/workflow/work/add_work/guanlian.png"><h1 class="fujian_h1" style="font-weight: bold;  font-size: 11pt;margin-top: 6px;"><fmt:message code="document.th.Relation" /></h1></li>
            <div class="position backbtn"><img src="../../img/workflow/work/add_work/back.png"></div>

            <div class="xiaxiang" >

                <%--关联流程--%>
                <div style="margin-top: 14px">
                    <li style="height:33px;line-height: 33px;position:relative;border:none;background: #50b7ff;margin-top: 0;width:  100%;margin: 0 auto;text-align: center">
                        <img class="fujian_logo" style="margin-top: 8px;margin-left: 5%" src="../../img/workflow/work/workform/关联.png">
                        <h1 class="fujian_h1" style="font-weight: bold;  font-size: 11pt;margin-top: 1px;color:#fff">关联流程</h1>
                        <a href="javascript:;" class="add_connect_work" style="display: none;">添加关联工作</a>
                    </li>
                    <div class="position backbtn" >
                        <img style="margin-top: -15px" src="../../img/workflow/work/workform/sanjiaozhankai.png">
                    </div>
                </div>
                <div id="xiangqing">
                    <div><ul id="connectList" style="display: block;padding: 5px 10px;box-sizing: border-box;"></ul></div>
                    <div id="uxiangqing">

                    </div>
                    <div id="liebiao"></div>
                </div>
                <li class="noData1" style="background: #f8f8f8;width:100%;height:199px;text-align: center;line-height:32px;margin: 0px;margin-top: 46px;border: none;">
                    <img src="/img/workflow/work/add_work/img_nomessage_03.png" alt="" style="margin-top: 16px;">
                    <span style="display: block;color: #666;">暂无关联流程</span>
                </li>

                <%--王润于11.1增加卡片部分--%>
                <div>
                    <li style="height:33px;line-height: 33px;position:relative;border:none;background: #50b7ff;margin-top: 0;width:  100%;margin: 0 auto;text-align: center;margin-top: 9px;"><img class="fujian_logo" style="margin-top: 8px;margin-left: 5%" src="../../img/workflow/work/workform/关联.png"><h1 class="fujian_h1" style="font-weight: bold;  font-size: 11pt;margin-top: 1px;color:#fff">关联卡片</h1></li>
                </div>
                <div class="cardWrap">

                </div>
                <li class="noData" style="background: #f8f8f8;width:100%;height:199px;text-align: center;line-height:32px;margin: 0px;margin-top: 46px;border: none;">
                    <img src="/img/workflow/work/add_work/img_nomessage_03.png" alt="" style="margin-top: 16px;">
                    <span style="display: block;color: #666;">暂无关联卡片</span>
                </li>


            </div>
        </ul>

    </div>

</div>
<div class="body" style="display: none;">
    <div class="head" style="position: fixed;z-index: 100000;top: 0px;">
        <div id="title" class="abs_left">
            <h1 class="num"></h1>
            <h2 class="step"></h2>
            <select class="opt" id="level" style="float: left">
                <option value="0"><fmt:message code="sup.th.ordinary" /></option>
                <option value="1"><fmt:message code="sup.th.urgent" /></option>
                <option value="2">特急</option>
            </select>
            <div class="tabAB">
                <ul class="clearfix">
                    <li class="fl active" data-id="1" ><fmt:message code="workflow.th.form" /></li>
                    <li class="fl" style="margin-left: 1px" data-id="2" ><fmt:message code="main.th.text" /></li>
                </ul>
            </div>
        </div>

<!--
        <div id="tab_t" class="abs_right">
            <ul>
                <li class="fujian"><a  href="javascript:void(0)"><fmt:message code="email.th.file" /></a></li>
                <li class="huiqian" ><a  href="javascript:void(0)"><fmt:message code="document.th.JointlySign" /></a></li>
                <li class="liucheng"><fmt:message code="doc.th.TechnologicalProcess" /></li>
                <li class="guanlian" style="border-right: none"><fmt:message code="document.th.Relation" /></li>
            </ul>
        </div>
		-->
    </div>
    <div class="content" id="content_module">
        <div class="cont" id="client">
            <div class="cont_form" id="a2" style="float: none;">
            </div>
            <div class="officialDocument clearfix" id="officialDocument" style="display: none;position:relative;z-index: 9999;">
                <iframe id="zw" name="zw" src="" frameborder="0" scrolling="yes" height="100%" width="100%" noresize="noresize" tid="2"></iframe>
            </div>
            <%--<div style="width: 100%;height: 52px;"></div>--%>
        </div>
        <div class="other_module">
            <!-- 公共附件 -->
            <div id="flowFiles" class="other_module_box" style="margin-bottom: 40px;">
                <div class="other_module_title">
                    公共附件
                </div>
                <table id="flowFilestable" class="other_module_table" border="1"
                       style="margin-bottom: 0; width: 100%;border-color: #fff;">
                    <thead>
                    <tr>
                        <th style="text-align: left;">附件名称</th>
                        <th style="text-align: left;width: 100px;">文件大小</th>
                    </tr>
                    </thead>
                    <tbody id="flowFilesTBody" class="other_module_tbody">

                    </tbody>
                </table>
            </div>
            <!-- 相关流程展示-->
            <div id="relevantProcesses" class="other_module_box" style="margin-bottom: 40px;">
                <div class="other_module_title">
                    相关流程
                </div>
                <table id="relevantProcessesTable" class="other_module_table" border="1" style="margin-bottom: 0; width: 100%;border-color: #fff;">
                    <thead>
                    <tr>
                        <th style="width: 120px;">流程类型</th>
                        <th>流程名称</th>
                    </tr>
                    </thead>
                    <tbody id="relevantProcessesTbody" class="other_module_tbody">

                    </tbody>
                </table>
            </div>
            <!-- 查阅情况-->
            <div id="readDetail" class="other_module_box" style="margin-bottom: 40px;">
                <div class="other_module_title">
                    查阅情况
                </div>
                <table id="readDetailTable" class="other_module_table" border="1" style="margin-bottom: 0; width: 100%;border-color: #fff;">
                    <thead>
                        <tr>
                            <th class="th" colspan="2">
                                已读人员
                            </th>
                            <th class="th" colspan="1" rowspan="2" style="width: 40%; border-left: 1px solid #ddd;">
                                未读人员
                            </th>
                        </tr>
                        <tr>
                            <th class="th" colspan="1">
                                姓名
                            </th>
                            <th class="th" rowspan="1">
                                已读时间
                            </th>
                        </tr>
                    </thead>
                    <tbody id="readDetailTbody" class="other_module_tbody">

                    </tbody>
                </table>
            </div>
            <!-- 交办详情 -->
            <div id="assignmentDetail" class="other_module_box" style="margin-bottom: 40px;">
                <div class="assignment_head other_module_title">
                    交办详情
                </div>
                <table id="assignmenttable" lay-filter="assignmenttable"></table>
            </div>
        </div>

        <div class="foot">
            <div class="foot_left" style="position: relative;z-index: 8887;width: 390px">
                <ul>
                    <li class="left_li" id="flowImg" style="width: 89px;"><img class="left_img" style="margin-top: 7px;" src="../../img/workflow/work/add_work/sheji.png"><h1 class="left_h1" style="font-weight: 300;"><fmt:message code="workflow.th.chart" /></h1></li>
                    <li class="left_li" id="parentOrChildBtn">
                        <img class="left_img" style="width: 18px; margin-top: 5px;" src="/img/workflow/work/workform/arrow_up.png"><h1 class="left_h1" style="font-weight: 300;">相关流程</h1>
                        <ul id="parentOrChildList">

                        </ul>
                    </li>
                    <%--  <li class="left_li"><img class="left_img" src="../../img/workflow/work/add_work/weituo.png"><h1 class="left_h1">委托</h1></li>--%>
                    <li class="left_li" id="print" style="width: 60px;"><img class="left_img" src="../../img/workflow/work/add_work/print.png"><h1 class="left_h1" style="font-weight: 300;"><fmt:message code="global.lang.print" /></h1></li>
                   <!--
				   <li class="left_li" id="attach_name" style="margin-left: 10px;"><img class="left_img" src="../../img/workflow/work/add_work/lan.png"><h1 class="left_h1" style="font-weight: 300;"><fmt:message code="email.th.file" /></h1></li>
               -->
			   </ul>
            </div>
            <div class="foot_rig" id="foot_rig" style="z-index: 8888; width: 917px;">
                <ul style="margin-left:-200px">
				<!--
                    <li class="rig_li more baocunfanhui"  id="more" style="position: relative">
                        <ul class="floatRight" style="position: absolute;display: none;background-color: #fff;">
                            <%--<li id="fenxiang" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one" ><fmt:message code="adding.th.sort" /></h1></li>--%>
                            <li id="guidang" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one" ><fmt:message code="workflow.th.File" /></h1></li>
                            <li id="daochu" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one" ><fmt:message code="global.lang.report" /></h1></li>
                            <li id="email" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one" >内部邮件</h1></li>
                            <li id="notice" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one">分享公告</h1></li>
                            <li id="shareSave" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one">转存</h1></li>
                            <li id="downloadFiles" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one">文件下载</h1></li>
                        </ul>

                        <h1 class="rig_h1 rig_h1one" ><fmt:message code="adding.th.more" /></h1></li>
						-->
                    <li class="rig_li  baocunfanhui"  id="associationOperation" style="position: relative;display: none">
                        <ul class="floatRight1" style="position: absolute;display: none;background-color: #fff;width:145px">
                            <%--<li id="guidang" style="width: 100%!important;"><h1 class="rig_h1 rig_h1one" ><fmt:message code="workflow.th.File" /></h1></li>--%>
                        </ul>

                        <h1 class="rig_h1 rig_h1one1" style="margin-left:10px" >公文操作</h1></li>
                    <li class="rig_li saveformlo" id="cancleBtn"><h1 class="rig_h1" ><fmt:message code="notice.th.return" /></h1></li>
					<!--
                    <li class="rig_li baocunfanhui" id="saveformback"><h1 class="rig_h1" ><fmt:message code="main.th.SaveReturn" /></h1></li>
                    -->
					<li class="rig_li saveformlo" id="saveform"><h1 class="rig_h1" style="width: 90px;"><fmt:message code="global.lang.save" /></h1></li>
                    <li class="rig_li hideen saveformlo" id="goback"><h1 class="rig_h1 "><fmt:message code="document.th.Fallback" /></h1></li>
                    <%--<li class="rig_li hideen add_sign" id="addSign"><h1 class="rig_h1 ">增加会签人</h1></li>--%>
                    <li class="rig_li hideen add_sign" id="addSign"><h1 class="rig_h1 ">增加经办人</h1></li>
                    <li class="rig_li zhuanjiao rig_h1onexiayibu"><h1 class="rig_h1" style="width: 82px;margin-left: 20px;"><fmt:message code="document.th.nextStep" /></h1></li>
                    <%--<li class="rig_li " id="noticeBottom"><h1 class="rig_h1" style="width: 82px;margin-left: 20px;">内部分发</h1></li>--%>

                </ul>
            </div>


            <div class="foot_rig" id="foot_rig1" style="display: none;z-index: 8888;">
                <ul>
                    <li class="rig_li saveformlo" id="cancleBtn1"><h1 class="rig_h1"><fmt:message code="depatement.th.quxiao" /></h1></li>
                    <li class="rig_li baocunfanhui" id="saveformback1"><h1 class="rig_h1" ><fmt:message code="main.th.SaveReturn" /></h1></li>
                    <li class="rig_li saveformlo" id="saveform1" style="width: 74px!important;"><h1 class="rig_h1" style="width: 90px;"><fmt:message code="global.lang.save" /></h1></li>
                    <%--<li class="rig_li hideen add_sign" id="addSign"><h1 class="rig_h1 ">增加会签人</h1></li>--%>
                    <li class="rig_li hideen add_sign" id="addSign"><h1 class="rig_h1 ">增加经办人</h1></li>
                    <li class="rig_li rig_h1onexiayibu" id="finish" style="height: 30px"><h1 class="rig_h1" style="width: 82px;margin-left: 20px;"><fmt:message code="workflow.th.FinishedProcessing" /></h1></li>
                </ul>
            </div>

        </div>

    </div>
    <div id="printdiv">
    </div>

</div>
<div id="readcommentstpl" class="layui-fluid layui-form " style="display:none;">
    <div class="layui-row layui-rows">
        <div class="layui-col-md12">
            <fieldset class="layui-elem-field layui-field-title" style="margin: 0;">
                <legend style="display: inline-block;width: 5em;border: 0;margin-bottom: 0;"> [送]方式</legend>
            </fieldset>

            <ul class="fl clearfix" style="padding-left: 35px;box-sizing: border-box;">
                <li class="layui-badge" style="margin: 5px">请</li>
                <li class="layui-badge" style="margin: 5px">送</li>
                <li class="layui-badge" style="margin: 5px">拟请</li>
                <li class="layui-badge" style="margin: 5px">转</li>
                <li class="layui-badge" style="margin: 5px">有请</li>
                <li class="layui-badge" style="margin: 5px">请各位领导</li>

            </ul>
        </div>
    </div>
    <div class="layui-row layui-rows" style="padding-top: 22px;">
        <fieldset class="layui-elem-field layui-field-title" style="margin: 0;">
            <legend style="display: inline-block;width: 9em;border: 0;margin-bottom: 0;">请选择部门和人员</legend>
        </fieldset>

        <div class="layui-col-md12">

            <select name="" class="select1" id="select11" style="vertical-align: middle;width: 29%;    margin-left: 35px; margin-right: 10%;" num="1">
                <option value="">请选择部门</option>

            </select>
            <select name="" id="select2" style="vertical-align: middle;width: 29%;" num="2">
                <option value="">请选择人员</option>

            </select>
        </div>

    </div>
    <div class="layui-row layui-rows">
        <div class="layui-col-md12">
            <fieldset class="layui-elem-field layui-field-title" style="margin:0">
                <legend style="display: inline-block;width: 5em;border: 0;margin-bottom: 0;">处理方式</legend>
            </fieldset>

            <ul class="fl clearfix" style="padding-left: 35px;box-sizing: border-box;">
                <li class="layui-badge" style="margin: 5px">办理</li>
                <li class="layui-badge" style="margin: 5px">已阅</li>
                <li class="layui-badge" style="margin: 5px">阅示</li>
                <li class="layui-badge" style="margin: 5px">阅</li>
                <li class="layui-badge" style="margin: 5px">提出意见</li>
                <li class="layui-badge" style="margin: 5px">批示</li>
                <li class="layui-badge" style="margin: 5px">协办</li>
                <li class="layui-badge" style="margin: 5px">研酌</li>
                <li class="layui-badge" style="margin: 5px">同意</li>
                <li class="layui-badge" style="margin: 5px">不同意</li>
                <li class="layui-badge" style="margin: 5px">研阅</li>
                <li class="layui-badge" style="margin: 5px">复印</li>
            </ul>
        </div>


    </div>
    <div class="centertion" style="width:100%;margin-left: 35px;margin-top: 10px; box-sizing: border-box">
        <textarea name="" id="" cols="30" rows="5" style="width: 84%;"></textarea>
    </div>
</div>
<div class="option"></div>
<div id="one" style="display: none;padding: 10px 30px 10px 0;">
    <form class="layui-form" lay-filter="newForm" id="addform">
        <div class="layui-form-item form_unit_item">
            <label class="layui-form-label" style="padding-left: 30px;padding-right: 0;text-align: left;">发文单位</label>
            <div class="layui-input-block">
                <select name="formUnit" class="form_unit" lay-filter="searchFormUnits">

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="padding-left: 30px;padding-right: 0;text-align: left;">单位类型</label>
            <div class="layui-input-block">
                <select name="unitType" class="unit_type" lay-filter="searchSelects">

                </select>
            </div>
        </div>
    </form>
    <div class="clearfix" style="height: 202px;">
        <div class="left" style="float:left;margin-left:30px;width:43%;border: 1px solid #ccc;border-radius: 5px;height: 200px;overflow: auto;">
            <ul class="dept_list">

            </ul>
        </div>
        <div style="float: left;width: 7%;text-align:center;margin: 0 2px;">
            <button class="selectall" style="margin-top: 60px;">全选</button>
            <button class="cancelall" style="margin-top: 10px;">清空</button>
        </div>

        <div class="right" style="float:right;width:43%;border: 1px solid #ccc;border-radius: 5px;height: 200px;overflow: auto;">
            <ul class="select_dept_list">

            </ul>
        </div>
    </div>
    <div class="remark_box" style="display: none;">
        <span>备注:</span>
        <textarea rows="3" id="remark" name="remark" style="width: 100%;resize: none;margin: 5px 0;box-sizing: border-box;"></textarea>
    </div>
    <div class="file_box">
        <span>请选择需要发送的附件:</span>
        <ul class="file_list">

        </ul>
    </div>

</div>

<%--工作办理--%>
<div id="workDone" style="display: none;padding: 10px 30px 10px 0;">
    <form class="layui-form" action="">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label" style="margin-top:30px;">办理汇报：</label>
            <div class="layui-input-block">
                <textarea id="neirong1" name="desc" placeholder=" " class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-upload" style="height: auto">
            <div id="demo3" style="padding-left: 110px;"></div>
            <label class="layui-form-label" style="margin-left: -22px;">附件：</label>

            <button type="button" class="layui-btn layui-btn-primary " id="test4" style="border: 0px;color:#3870d7;margin-left:5px;"><img src="/img/icon_uplod.png" style="margin-right:5px;"><i style="display: none" class="layui-icon"></i>附件上传</button>
        </div>

        <div class="layui-form-item " >
            <label class="layui-form-label" style="margin-left: -22px;">提醒：</label>
            <div class="layui-input-block" >
                <input   type="checkbox"  name="smstype" value="5" title="发送事务提醒消息" lay-skin="primary" checked>
                <input  type="checkbox"  name="smstype" value="6" title="使用手机短信提醒" lay-skin="primary">
            </div>
        </div>
    </form>

</div>

<%--工作交办--%>
<div id="work" style="display: none;padding: 10px 30px 10px 15px;">
    <form class="layui-form" lay-filter="workForm" action="">
        <%--        <div class="layui-form-item layui-form-text">--%>
        <%--            <label class="layui-form-label" style="margin-top:30px;">交办内容：</label>--%>
        <%--            <div class="layui-input-block">--%>
        <%--                <textarea id="neirong" name="desc" placeholder="" style="display: inline-block;width: 300px;" class="layui-textarea"></textarea>--%>
        <%--	            <div style="display: inline-block;">--%>
        <%--                    <a href="javascript:;" id="assignmentSign" style="color: blue; text-decoration: none;">添加常用意见</a>--%>
        <%--                </div>--%>
        <%--            </div>--%>
        <%--        </div>--%>
        <div class="layui-form-item ">
            <label class="layui-form-label">办理人：</label>
            <div class="layui-input-block " >
                <textarea id="chargePerson" user_id="" type="text" required disabled name="title" style="display: inline-block;width: 300px;resize:none;min-height: 50px;"class="layui-textarea"></textarea>
                <div style="display: inline-block;">
                    <a href="javascript:;" id="userAdd" style="color: blue; text-decoration: none;">添加</a>
                    <a href="javascript:;" id="delUser" style="color: red; text-decoration: none;">清除</a>
                </div>
            </div>
        </div>

        <%--        <div class="layui-form-item " style="font-size: 13px">--%>
        <%--            <label class="layui-form-label laclass" style="width: 145px;">是否允许填写会签意见：</label>--%>
        <%--            <input id="yesr"   type="radio" name="opinionType" title="是"  checked ><input id="nor"   title="否" type="radio" name="opinionType"  value="1"  >--%>
        <%--        </div>--%>


        <div class="layui-upload" style="height: auto">
            <div id="demo2" style="padding-left: 110px;"></div>
            <label class="layui-form-label">附件：</label>
            <button type="button" class="layui-btn layui-btn-primary " id="test3" style="border: 0px;color:#3870d7;padding: 0;"><img src="/img/icon_uplod.png" style="margin-right: 5px;"><i style="display: none" class="layui-icon"></i>附件上传</button>
        </div>

        <div class="layui-form-item " >
            <label class="layui-form-label">提醒：</label>
            <div class="layui-input-block" >
                <input   type="checkbox"  name="smstype" value="5" title="发送事务提醒消息"  lay-skin="primary" checked>
                <input  type="checkbox"  name="smstype" value="6" title="使用手机短信提醒" lay-skin="primary">
            </div>
        </div>
    </form>
</div>
<!--
    <div id="scrollModule">
        <div id="scrollTop">
            <img src="/img/workflow/m/scrollTop.png">
        </div>
        <div id="scrollBottom" style="margin-top: 10px">
            <img src="/img/workflow/m/scrollBottom.png">
        </div>
    </div>-->
<!-- 交办详情 -->
<script type="text/html" id="assignmentBar">
    {{#  if(d.handleStatus != 2 && d.handleUser == userId){ }}
    <a class="layui-btn layui-btn-xs" lay-event="1">办理</a>
    <a class="layui-btn layui-btn-xs" lay-event="2">交办</a>
    {{#  } }}
</script>

</body>
<script type="text/javascript" src="/js/spirit/qwebchannel.js"></script>
<script>
    var userId = $.cookie('userId');
    if(userId == null){
        $.ajax({
            type: "post",
            url: "/users/getUserTheme",
            dataType: 'json',
            async:false,
            success: function (res) {
                var data = res.object;
                userId = data.userId;
            }
        })
        $.cookie('userId',userId,{expires: 7})
    }
    layui.use(['form', 'layer','upload'], function() {
        var form = layui.form;
        var layer = layui.layer;
        var $ = layui.jquery
            ,upload = layui.upload;
    });
    //查看当前流程是否已办结, 已办结跳转至详情页面
    $.ajax({
        url: '/workflow/work/selectFind',
        type: 'GET',
        data: {
            flowId: $.GetRequest().flowId,
            prcsId: $.GetRequest().flowStep,
            flowPrcs: $.GetRequest().prcsId,
            runId:$.GetRequest().runId
        },
        async: false,
        success: function(res) {
            if (res.flag && res.object == 'err') {
                var href = location.href.replace('workform', 'workformPreView')
                alert('当前流程已办结，点击前往详情页面')
                location.href = href
            }
        },
        error: function(){

        }
    })

    // 显示父子流程
    $('#parentOrChildBtn').on('click', function(){
        $('#parentOrChildList').toggle()
    })
    //查看相关程表单功能
    $(document).on('click', '.parent_child_item', function(){
        var flowId = $(this).attr('flowid')
        var runId = $(this).attr('runid')
        window.open('/workflow/work/workformPreView?flowId='+ flowId +'&prcsId=&flowStep=&runId='+runId);
    })
    //上传
    function appendByGallery(){

    }
    function checkStr(str){
        if(str==''||typeof(str)=='undefined'){
            return '无'
        }else{
            return str
        }
    };
    function getCard(){
        var uurrll = window.location.href;
        // var ssssss = 'http://localhost:8080/workflow/work/workform','flowId=214&type=new&flowStep=1&prcsId=1&runId=23161';
        var str1 = uurrll.split('?')[1];
        var arr1 = str1.split('&');
        var objectA = {};
        for(var x = 0;x<arr1.length;x++){
            if(arr1[x].split('=')[0]=='flowId'){
                objectA['flowId'] = arr1[x].split('=')[1];
            }else if(arr1[x].split('=')[0]=='runId'){
                objectA['runId'] = arr1[x].split('=')[1];
            }
        }
        objectA.printModel = workForm.option.attributesTitle;
        objectA.attributesStr = workForm.option.attributesStr
        return objectA;
    };
    function hr(){
        window.open('/hr/page/hrOnJop')
    }
    function person(){
        window.open('/controlpanel/personInfor?type=0')
    }
    function isExitsFunction(funcName) {//判断是否是一个方法
        try {
            if (typeof(eval(funcName)) == "function") {
                return true;
            }
        } catch(e) {}
        return false;
    };
    function autodivheight(){
        var winHeight=0;
        if (window.innerHeight)
            winHeight = window.innerHeight;
        else if ((document.body) && (document.body.clientHeight))
            winHeight = document.body.clientHeight;
        if (document.documentElement && document.documentElement.clientHeight)
            winHeight = document.documentElement.clientHeight;
        winWidth = document.documentElement.clientWidth;
        document.getElementById("officialDocument").style.height= winHeight - 93 +"px";
        //document.getElementById("officialDocument").style.height= winHeight - 98 +"px";
    };
    // 点击子流程跳转到详情页
    $(document).on('click', '.child_flow', function(){
        var url = $(this).data('url');
        $.popWindow(url);
    });
    function openFiledaochu(text) {
        $.post('/rmsFile/createFormHtml',{
            htmlContent:text,
            typeFlag:2
        },function (json) {
            if(json.flag){
                window.open('/download?'+encodeURI(json.object.attUrl));
            }
        },'json')
    };
    setTimeout(function(){
        $.ajax({
            url:'/flowModelAssociationSet/getFlowRunInfo',
            data:getCard(),
            dataType:'json',
            type:'post',
            success:function(res){
                var json = res.object;
                if(json){
                    if(json.length<=0){
                        $('.noData').css('display','block');
                    }else{
                        $('.noData').hide();
                        if( json[0]['hrStaffInfo']!=undefined){
                            var hrStaffInfos = json[0]['hrStaffInfo'][0];//人事档案卡片
                        }
                        if(json[0]['users']!=undefined){
                            var hrStaffContract = json[0]['users'];//合同档案卡片
                        }
                        if(json[0]['eduFixAssets']!=undefined){
                            var eduFixAssets = json[0]['eduFixAssets'];//固定资产卡片
                        }

                        if(json[0]['institutionContents']!=undefined){
                            var institutionContents = json[0]['institutionContents'];//制度卡片
                        }


                        if(hrStaffInfos){
                            var str = '<div class="card" id="hr" onclick="hr()" style="height:236px">'+
                                '<div class="cardHead">'+
                                '<img src="/img/workflow/flowsetting/settingApplication/archivesCard.png" style="margin-left: 15px;margin-top: -3px;"/>'+
                                '<span class="cardName">人事档案卡片</span>'+
                                '</div>'+
                                '<div class="headImg">'+
                                '<div class="portrait">'+
                                '<img class="userPhotoImg" src="/img/workflow/flowsetting/settingApplication/menImg.png"/>'+
                                '</div>'+
                                '<div class="nameDetail">'+
                                '<p class="name1">'+checkStr(hrStaffInfos.staffName)+'</p>'+
                                '<p class="nameStatus">'+checkStr(hrStaffInfos.deptName)+'</p>'+
                                '<p class="nameStatus">'+checkStr(hrStaffInfos.userPriv)+'</p>'+
                                '</div>'+
                                '</div>'+
                                '<div class="details">'+
                                '<p><span class="deWd">性别：'+function(){if(hrStaffInfos.staffSex=="0"){return "男"}else{return "女"}}()+'</span><span class="deWds">年龄：'+checkStr(hrStaffInfos.staffAge)+'</span></p>'+
                                '<p><span class="deWd">学历：'+checkStr(hrStaffInfos.staffHighestSchool)+'</span><span class="deWds">职称：'+checkStr(hrStaffInfos.persenPosition)+'</span></p>'+
                                '<p><span class="deWd">岗位：'+checkStr(hrStaffInfos.workJob)+'</span><span class="deWds">入职时间：'+checkStr(hrStaffInfos.datesEmployed)+'</span></p>'+
                                '<p>户籍：'+checkStr(hrStaffInfos.staffDomicilePlace)+'</p>'+
                                '</div>'+
                                '</div>';

                            $('.cardWrap').append(str);
                            if(hrStaffInfos.photoName){
                                $('.userPhotoImg').attr('src',hrStaffInfos.photoName)
                            }else if(hrStaffInfos.photoName==''){
                                if(hrStaffInfos.staffSex==0){
                                    $('.userPhotoImg').attr('src',"/img/workflow/flowsetting/settingApplication/menImg.png")
                                }else if(hrStaffInfos.staffSex==1){
                                    $('.userPhotoImg').attr('src',"/img/workflow/flowsetting/settingApplication/womenImg.png")
                                }
                            }
                        };

                        if(hrStaffContract){
                            var str1 = '<div class="card" onclick="person()">'+
                                '<div class="cardHead">'+
                                '<img src="/img/workflow/flowsetting/settingApplication/archivesCard.png" style="margin-left: 15px;margin-top: -3px;"/>'+
                                '<span class="cardName">个人资料卡片</span>'+
                                '</div>'+
                                '<div class="headImg">'+
                                '<div class="portrait">'+
                                '<img class="userPhotoImg" src="'+function(){
                                    if (hrStaffContract[0].avatar128 != "" && hrStaffContract[0].avatar128 != undefined ) {
                                        return '/img/user/' + hrStaffContract[0].avatar128;
                                    }else{
                                        if (hrStaffContract[0].sex == 0) {
                                            return '/img/user/boy.png';
                                        }
                                        else if (hrStaffContract[0].sex == 1) {
                                            return '/img/user/girl.png';
                                        }else{
                                            return '/img/user/boy.png'
                                        }
                                    }

                                }()+'"/>'+
                                '</div>'+
                                '<div class="nameDetail">'+
                                '<p class="name1">'+checkStr(hrStaffContract[0].userName)+'</p>'+
                                '<p class="nameStatus">'+checkStr(hrStaffContract[0].dep.deptName)+'</p>'+
                                '<p class="nameStatus">'+checkStr(hrStaffContract[0].userPrivName)+'</p>'+
                                '</div>'+
                                '</div>'+
                                '<div class="details" style="line-height: 24px;">'+
                                '<p>工作电话：'+checkStr(hrStaffContract[0].telNoDept)+'</p>'+
                                '<p>手机：'+checkStr(hrStaffContract[0].mobilNo)+'</p>'+
                                '<p>邮箱：'+checkStr(hrStaffContract[0].msn)+'</p>'+
                                '<p>QQ：'+checkStr(hrStaffContract[0].oicqNo)+'</p>'+

                                '</div>'+
                                '</div>';

                            $('.cardWrap').append(str1);
                        };

                        if(eduFixAssets){
                            var str2=""
                            if(eduFixAssets.length>0){
                                for(var i=0;i<eduFixAssets.length;i++){
                                    str2 += '<div class="card" style="height:245px">'+
                                        '<div class="cardHead">'+
                                        '<img src="/img/commonTheme/theme6/fixAssetsManage.png" style="margin-left: 15px;margin-top: -3px;width:18px"/>'+
                                        '<span class="cardName">固定资产卡片</span>'+
                                        '</div>'+
                                        '<div class="details" style="margin-top:5px;margin-left:20px;line-height:25px;padding-bottom:5px">' +
                                        '<p>固定资产编号：GDZC2019010100008</p>\n' +
                                        '                                    <p>资产名称：<span>'+checkStr(eduFixAssets[i].assetsName)+'</span></p>' +
                                        '                                    <p>购买时间：<span>'+checkStr(eduFixAssets[i].buyTime)+'</span></p>' +
                                        '                                    <p>品牌型号：<span>'+checkStr(eduFixAssets[i].info)+'</span></p>' +
                                        '                                    <p>类别：<span>'+checkStr(eduFixAssets[i].typeName)+'</span></p>' +
                                        '                                    <p>使用年限：<span>'+checkStr(eduFixAssets[i].useYy)+'月</span></p>' +
                                        '                                    <p>保管人：<span>'+checkStr(eduFixAssets[i].keeperName)+'</span></p>' +
                                        '                                    <p>物品状态：<span>'+function(){
                                            if(eduFixAssets[i].status == '1'){
                                                return '未使用'
                                            }else if(eduFixAssets[i].status == '2'){
                                                return '使用'
                                            }else if(eduFixAssets[i].status == '3'){
                                                return '损坏'
                                            }else if(eduFixAssets[i].status == '4'){
                                                return '丢失'
                                            }else if(eduFixAssets[i].status == '5'){
                                                return '报废'
                                            }else{
                                                return '无'
                                            }
                                        }()+'</span></p>'+
                                        '</div>'+
                                        '</div>';
                                }
                            }

                            $('.cardWrap').append(str2);
                            var innerTable = '';
                            for(var x = 0;x<eduFixAssets.length;x++){
                                innerTable+=
                                    '<tr style="text-align:center">' +
                                    '<td>'+checkStr(eduFixAssets[x]['id'])+'</td>'+
                                    '<td>'+checkStr(eduFixAssets[x]['assetsName'])+'</td>'+
                                    '<td><div class="showQRCode" style="height:30px;width:30px;border:1px solid black;cursor:pointer"></div>' +
                                    '</td>'+
                                    '</tr>';
                            };
                            $('.eduTbody').html(innerTable);
                            for(var x = 0;x<$('.showQRCode').length;x++){
                                var createrTime = eduFixAssets[x]['createrTime'];
                                var id = eduFixAssets[x]['id'];
                                var companyId = eduFixAssets[x]['companyId'];
                                var obj ={"mark":"fixAssets","id":id,"createrTime":createrTime,"companyId":companyId};
                                var text = JSON.stringify(obj);
                                var qrcode = new QRCode(document.getElementsByClassName("showQRCode")[x], {
                                    width : 30,//设置宽高
                                    height : 30,
                                    text:text
                                });
                                $('.showQRCode img').attr('alt','点击放大')
                            }
                            $('.bigImg').hide();
                            $('.closeBigImg').hide();
                            $('.showQRCode').click(function(){
                                $('.bigImg').html('');

                                var obj =$(this).attr('title');
                                var text = JSON.stringify(obj);
                                var qrcode = new QRCode(document.getElementsByClassName("bigImg")[0], {
                                    width : 200,//设置宽高
                                    height : 200,
                                    text:text
                                });
                                $('.bigImg img').css({marginLeft:39});
                                $('.bigImg img').attr('alt','点击返回');
                                $('.bigImg').css({zIndex:5}).show();
                                $('.closeBigImg').show();
                            })
                            $(".closeBigImg").click(function(){
                                $(this).hide();
                                $('.bigImg').css({zIndex:-5}).hide()
                            })
                        };
                    }
                }
            }
        });

        //关联制度
        $.ajax({
            url: '/InstitutionContent/getContenFlowRun',
            data: {
                flowId:$.GetRequest().flowId
            },
            dataType: 'json',
            type: 'post',
            success: function (res) {
                var obj = res.obj;
                if(res.flag && obj.length > 0 ){
                    var str = '<div class="card" style="height:245px">'+
                        '<div class="cardHead">'+
                        '<span class="cardName" style="margin-left: 10px;">制度管理卡片</span>'+
                        '</div>'+
                        '<div class="details" style="margin-top:5px;margin-left:20px;line-height:25px;padding-bottom:5px">';
                    for (var i = 0; i < obj.length; i++) {
                        str+='<p>' +
                            '<span>' +
                            obj[i].instName +
                            '</span>'+
                            '<a target="_blank" href="/institution/selectInstitution?instId='+obj[i].instId+'" type="button" class="layui-btn layui-btn-normal layui-btn-xs" style="float: right; margin-right: 20px;">查看</a>' +
                            '</p>';
                    }
                    str+= '</div>'+
                        '</div>';

                    $('.cardWrap').append(str);
                }
            }
        });

    },2000);
    //控制高度
    layer.load();
    $('.body').show();
</script>
<script>
    parent.opener = window.opener;
    var globalData = {};
    var flowrunId=null;
    var eventas=null;
    var runId = $.GetRequest().runId;
    var SignLoadFlag = false;
    var sign_arr = [];
    var paraValue = 0;
    var deptNo = "";
    isIE = function() {
        return !!(window.ActiveXObject || "ActiveXObject" in window);
    }
    window.onresize = function(){
        var tableName = $.getQueryString("tableName") || '';
        if(tableName != ''){
            // location.reload();
        }else{
            $('#tab_c').css('height',$('body').height()-52);
        }
    };
    //定制化需求
    $.get('/syspara/selectProjectId',function (res) {
        globalData.projectId=res.object
        if(res.object=='dazu'){
            $(".huiqian_h1").text('处理意见')
            $("#tab_t .huiqian a").text('处理意见').width('90px')
            $(".guanlian").hide();
            $("#tab_c").show();
            $(".abs_right ul").width('273px')
            $("#tab_t ul li").width('90px')
            $(".fujian a").width('90px')
            $(".fujian").addClass('check').children('a').css('color','white')
        }
    });
    $('.cont_cfour').on('click','.detailFlow',function(e){
        e.stopPropagation()
        var runId = $(this).attr('runId');
        var flowId = $(this).attr('flowId');
        var prcsId = $(this).attr('prcsId')
        var flowStep = $(this).attr('flowStep');
        window.open('/workflow/work/workformPreView?flowId='+flowId+'&prcsId='+prcsId+'&flowStep='+flowStep+'&runId='+runId,'_blank')
    });
    function openFile(a) {
        $.post('/rmsFile/createFormHtml',{htmlContent:a,typeFlag:1},function (json) {
            if(json.flag){
                $('#ifDiv').remove();
                window.open('/rmsFile/toAdd?aid='+json.object.aid+'&runId='+runId);
            }
        },'json')
    };
    function guanlian(){
        var flowId = $.getQueryString("flowId");
        if(flowId != undefined){
            $(".cont_cfour").hide();
            $.ajax({
                url:'/flowModelAssociationSet/queryFlowAssociation',
                type:'get',
                data:{
                    flowId:flowId,
                    type:1
                },
                dataType:'json',
                success:function(data){
                    var x = data.obj;
                    if(x.length != 0){
                        $('.noData1').hide();
                        // $('.noData').hide();
                        $(".xiaxiang").show();
                        for(var i=0;i<x.length;i++){
                            var cur = x[i];
                            $.each(cur,function (key,value) {
                                var str = '';
                                str+='<ul class="xiangqing" id="sange" style="width: 279px;display: block;margin: 0 auto; margin-top: 14px; border: 1px solid #cccccc;border-top: 2px solid #0081ef;border-bottom: none">'+'<li style="height: 42px;line-height: 42px;border-bottom: 1px solid #b0d2fc">'+'<img src="../../img/workflow/work/workform/流程.png" style="display: inline-block;margin-left: 17px;text-align: center;vertical-align: middle" alt="">'+'<h3 id="baoxiu" style="display:inline-block;vertical-align: middle;text-align: center;margin-left: 5px;font-size: 16px;color:#0081ef">'+key+'</h3>'+'<span style="font-size: 14px;color:#2b7fe0;text-align: center;vertical-align: middle;cursor: pointer;margin-left:30px" id="association">'+"关联条件"+'</span>'+'<a href="javascript:;" style="font-size: 14px;color:#2b7fe0;text-align: center;vertical-align: middle;text-decoration: none;margin-left:18px;" id="morethings">'+"更多"+'</a>'+'</li>'+'</ul>';
                                $('#uxiangqing').append(str);
                                var str1 = '';
                                for(var k=0;k<value.length;k++){
                                    str1+='<li id="liebiaoye" style="width: 90%;margin: 0 auto;height: 50px;border-bottom: 1px dashed #b0d2fc;padding-left: 8px;padding-top: 2px;font-size: 14px;cursor: pointer;">'+'<p style="margin-top: 4px">'+"流水号:"+value[k].flowRun.runId+'</p>'+'<h4 style="display: inline-block;">'+"工作名称/文号:"+'</h4>'+'<a href="javascript:;" style="color:#0081ef" class="detailFlow" title="'+key+'" runId="'+value[k].flowRun.runId+'" flowStep="'+value[k].flowPrcs+'" prcsId="'+value[k].prcsId+'" flowId="'+value[k].flowId+'"><span style="display: inline-block;margin-left: 8px">'+key+'</span></a>'+'<span  style="padding-top: 2px;font-size: 14px;display: inline-block;margin-left: 3px">'+value[k].createTime.slice(0,10)+'</span>'+'</li>'
                                }
                                $('#uxiangqing').append(str1);
                            })
                        }
                    }else{
                        $(".cont_cfour").show();
                        $(".noData1").show();
                        // $('.noData').hide();
                    }
                },
                error:function(data){
                    $(".cont_cfour").show();
                    $(".noData1").show();
                    // $('.noData').hide();
                }
            })
        }else{
            $(".cont_cfour").show();
            $(".noData1").show();
            // $('.noData').hide();
        }

    };
    //详情页
    function tiaozhuan() {
        // $("#liebiaoye").live('click',function () {
        //     window.location.href = "/workflow/work/workformPreView?flowId=323&flowStep=&runId=8331&prcsId="
        // })
    };
    //关联条件
    function association () {
        $("#association").live('click',function () {
            window.open("/flowModelAssociationSet/flowModelAssociationSetList?flowId="+$.GetRequest().flowId)
            // window.location.href = "/flowModelAssociationSet/flowModelAssociationSetList?flowId="+flowId
        })
    };
    //关联更多
    function morethings() {
        var flowId = $.getQueryString("flowId");
        $("#morethings").live('click',function () {
            var flowId = $.getQueryString("flowId");
            window.open("/workflow/work/workLists?flowId="+flowId)
        })
    };
    //初始化下拉控件
    function initSelect() {
        createSelectArr();
        //初始化下拉菜单
        firstSelectArr.forEach(function(n, i){
            selectChange(n);
        });
    }
    //selectArr储存所有的下拉菜单
    var selectArr = new Array();
    //缓存顶级下拉菜单
    var firstSelectArr = new Array();
    var restoreFlag = false;
    function createSelectArr() {
        allSelect = $("select");
        //首次循环，将下拉菜单值保存为全局变量多维数组
        allSelect.each(function(){
            var field_name = $(this).attr("name");

            selectArr[field_name] = new Array();
            $(this).children().each(function(i, e){
                selectArr[field_name][i] = e.value;
            });
        });
        //再次循环，所有的父菜单存到数组中，用于更新状态
        allSelect.each(function(i){
            //赋重写事件
            $(this).change(function(){
                selectChange($(this).attr("name"));
            });
            //判断有子菜单的
            if($(this).attr("child")) {
                var temp = $(this).attr("title");
                if(!$("select[child='"+temp+"']")[0] ) {
                    firstSelectArr[i] = jQuery(this).attr("name");
                }
            }
        });
    }
    //处理关联菜单的子菜单选项,传入：关联菜单
    function selectChange(Select) {
        var SelectObj = $("select[name='"+Select+"']");
        var parent_str = "|"+$(SelectObj).val();
        if($(SelectObj).attr("child") != undefined) {
            //子对象
            var childObj = $("select[title='"+$(SelectObj).attr("child")+"']");
            if(childObj.length == 0){return false;}
            //记录原始数据，重写option后用此值恢复
            var childVal = $(childObj).val();
            //先删除所有option
            childObj.children().remove();
            //循环添加option
            selectArr[$(childObj).attr("name")].forEach(function(n, i){
                if(restoreFlag){
                    if(parent_str!='|' && n.indexOf(parent_str) != -1)
                    {
                        var val_arr = n.split("|");
                        $(childObj).append("<option value='"+n+"'>"+val_arr[0]+"</option>");
                    }
                }else{
                    var val_arr = n.split("|");
                    $(childObj).append("<option value='"+n+"'>"+val_arr[0]+"</option>");
                }
            });
            childObj.val(childVal);
            selectChange($(childObj).attr("name"));
            if($(childObj).attr('calcutarget')!=undefined){
                var targetId = $(childObj).attr('calcutarget');
                targetId = targetId.split(',');
                targetId.forEach(function (item,i) {
                    var targetObj = $('#'+item) ;
                    if(targetObj.attr('disabled') == 'disabled'){
                        return false;
                    }
                    if(targetObj.val()==undefined||targetObj.val()=='undefined'){
                        return false;
                    }
                    var prec = targetObj.attr('prec')||3;
                    var calculationValue = targetObj.attr('formula');
                    var obj=[];
                    for(var i=0;i<$('.calculation').length;i++){
                        var title = $('.calculation').eq(i).attr('title');
                        if(calculationValue.indexOf(title) > -1 ){
                            var id=$('.calculation').eq(i).attr('id')
                            obj.push({
                                id: $('.calculation').eq(i).attr('id'),
                                title: $('.calculation').eq(i).attr('title'),
                                value:function () {
                                    if($('.calculation').eq(i).val()!=''&& $('.calculation').eq(i).val()!=undefined){
                                        return $('.calculation').eq(i).val().replace(/[^\d.]/g,"")
                                    }else{
                                        return ''
                                    }
                                }()
                            })
                        }
                    }
                    calculationValue = $.transforFormula(calculationValue,obj);
                    var vv = '';
                    if(calculationValue.indexOf('DAY') >-1){
                        vv = execC(calculationValue,2);
                        vv= Math.floor(vv);

                    }else{
                        vv = execC(calculationValue,prec)
                    }
                    targetObj.val(vv).trigger("propertychange");
                });
            }
        }
        else {
            return;
        }
    }
    var flowId = '';
    var saveFlowData = null;
    $(function(){
        guanlian();
        morethings();
        association();
        tiaozhuan();
        flowId = $.getQueryString("flowId");
        var flowStep = $.getQueryString("flowStep") || '';
        var prcsId = $.getQueryString("prcsId") || '';
        var prcsName = $.getQueryString("prcsName") || '';
        var runId = $.getQueryString("runId") || '';
        var type = $.getQueryString("type") || '';
        var tableName = $.getQueryString("tableName") || '';
        var tabId =  $.getQueryString("tabId") || '';
        var isNomalType =  $.getQueryString("isNomalType") || '';
        var opflag =  $.getQueryString("opflag") || 1;
        var type = $.getQueryString("type") || '';
        var guide = $.getQueryString("guide") || '';
        try{
            if(parent.opener == null||parent.opener.location.pathname =='/workflow/work/addwork'
                ||parent.opener.location.pathname =='/document/addresseeRegistrationForm'
                ||parent.opener.location.pathname =='/document/draftArticlesOfCommunication'){
                type = 'new';
            }
        }catch(err){
            type = 'new';
        }

        if(tableName == 'document'){
            if(type != 'new'){
                var documentitleName = '公文办理';
            }else{
                var documentitleName = '新建公文';
            }
        }else{
            if(type != 'new'){
                var documentitleName = '流程办理';
            }else{
                var documentitleName = '新建流程';
            }
        }
        if(opflag == 1){
            $('title').html(documentitleName);
        }else if(opflag == 0){
            $('title').html('<fmt:message code="work.th.huiqian" />');
        }

        var navigatorName = "Microsoft Internet Explorer";
        var isIE = false;
        var userId=$.GetRequest().userId || '';
        var gobackIndex = 0;
        var iconImgType = {
            txt : '/img/workflow/work/txt.png',
            jpg : '../../img/icon_image.png',
            png : '../../img/icon_image.png',
            pdf :  '/img/workflow/work/pdf.png',
            ppt : '/img/workflow/work/ppt.png',
            pptx :  '/img/workflow/work/ppt.png',
            doc : '/img/workflow/work/doc.png',
            docx : '/img/workflow/work/doc.png',
            xls :  '/img/workflow/work/xls.png',
            xlsx :  '/img/workflow/work/xls.png',
            rar: '/img/workflow/work/rar.png',
            zip: '/img/workflow/work/zip.png',
            html: '/img/workflow/work/html.png',
            xmind: '/img/workflow/work/xmind.png'
        };
        $('body').css('height',document.documentElement.clientHeight-52);
        if( navigator.appName == navigatorName ){
            isIE = true;
            $('#uploadinputimg').css({
                'opacity':'1',
                'filter': 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
            })
            $('#add_fujian').hide();
        };
        $('.cont_cthr').find('iframe').prop('src','/flowSetting/processDesignToolsT?type=2&flowId='+flowId);
        $('#uploadimgform').attr('action','workUpload?module=workflow&prcsId='+flowStep+'&runId='+runId+'&flowPrcs='+prcsId+'&runId='+runId);
        $('#tab_c').css('height',$('body').height()-52);
        $(window).resize(function () {
            var  height=document.documentElement.clientHeight;
            $('#tab_c').css('height',height-52);
            $('#officialDocument').css('height',height-93);
        })

        if(isNomalType == 'false'){
            $('.tabAB').show();
            $('.opt').show();
            $('.step').show()
            $('.tabAB ul li').click(function () {
                $(this).siblings().removeClass('active');
                $(this).addClass('active');
                if($(this).attr('data-id')==1){
                    try {
                        $(window.parent.document).contents().find("#zw")[0].contentWindow.isSaveOffice();
                    } catch (e) {
                        console.log(e);
                    }
                    $('#a2').show();
                    $('#tab_t').show();
                    $('.officialDocument').hide();

                    $("#zw").contents().find("object").hide();
                    $('#client').css('height', 'auto');
                    $('#content_module').css('margin-bottom','80px');
                    $('.other_module').show();
                }else if($(this).attr('data-id')==2){
                    $('#content_module').css('margin-bottom','52px');
                    $('.other_module').hide();
                    $('.backbtn').eq(0).click();
                    if(tabId != ''){
                        autodivheight();
                        $.ajax({
                            url:'/syspara/selectTheSysPara?paraName=OFFICE_EDIT',
                            type:'post',
                            datatype:'json',
                            success: function (res) {
                                var url = '';
                                if(res.flag){
                                    if(res.object[0].paraValue == 0){
                                        //默认加载NTKO插件 进行跳转
                                        url = '/common/ntko?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag;

                                    }else{
                                        url = '/common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag;
                                    }
                                }else{
                                    url = '/common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag;
                                }

                                var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串,判断是否是pc客户端打开的qt浏览器，因为无法打印做一个兼容处理
                                if(userAgent.indexOf('QtWebEngine') > -1&&location.href.indexOf('&ie_version=8') > -1){
                                    url += '&ie_open=yes';
                                    window.open(url);
                                }else{
                                    $('#zw').prop('src',url);
                                }
                            },
                            error:function(xhr){
                                $('#zw').prop('src','/common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag);
                            }
                        })
                    }
                    $('#a2').hide();
                    $('#tab_t').hide();
                    $('.officialDocument').show()
                    $("#zw").contents().find("object").show();
                }
            });
        }
        //引入方法
        workForm.init({
            formhtmlurl:'../../workflow/work/workfastAdd',//URL
            resdata:{
                flowId:flowId,
                runId:runId,
                prcsId:prcsId,
                flowStep:flowStep,
                userId:userId,
                tableName:tableName,
                tabId:tabId
            },
            flowStep:prcsId,//预览
            target:'.cont_form'
        }, function (data,option) {
            workForm.inited = true;
            if(data.turn){//为true的话，证明该步骤已转交，关闭当前界面
                layer.open({
                    content:'<span style="color: #000;">当前步骤已转交</span>',
                    icon:2,
                    success:function(index){
                        setTimeout(function(){
                            window.location.href = '/workflow/work/workformPreView?flowId='+ flowId +'&prcsId='+ prcsId +'&flowStep='+ flowStep +'&runId='+runId;
                        }, 1500);
                    },
                    yes:function (index) {
                        window.location.href = '/workflow/work/workformPreView?flowId='+ flowId +'&prcsId='+ prcsId +'&flowStep='+ flowStep +'&runId='+runId;
                    },
                    cancel:function (index) {
                        window.close();
                    }
                })
            }else{
                $('.imgupload').load(function () {
                    if($(this).attr('width')!=50){
                        if($(this).parent().is('p')){
                            $(this).parent('p').css({
                                'border':'2px dotted #5fa5e7',
                                'margin': '0 auto',
                                'height':$(this).attr('height'),
                                'width': $(this).parents('td').width()-3,
                                'vertical-align': 'middle',
                                'display': 'table-cell'
                            })
                        }else{
                            $(this).parents('td').css({
                                'height':$(this).attr('height'),
                            })
                        }
                    }
                })
                //声明下签章、手写控件START
                if($('input[data-type=djsign]').length != 0){
                    loadwebsign();
                    function DWebSignSealFUN(){
                        SignLoadFlag = true;
                        for(var i=0;i<$('input[data-type=djsign]').length;i++){
                            sign_arr.push($('input[data-type=djsign]').eq(i).attr('name'));
                        }
                        DWebSignSeal = document.getElementById("DWebSignSeal");
                        LoadSignData(sign_arr);
                    }
                    DWebSignSealFUN()
                }
                //声明下评分控件START
                if($('.mark').length != 0){
                    for(var i=0;i<$('.mark').length;i++){
                        var disabled = $('.mark .form_item').eq(i).attr('disabled');
                        var formItemId = $('.mark .form_item').eq(i).attr('name');
                        var value = $('.mark .form_item').eq(i).val();
                        scoreFun($("#startone"+formItemId));
                        if(value != '-1'){
                            $("#startone"+formItemId).find('a').eq(value).addClass('clibg');
                        }
                        if(disabled == 'disabled'){
                            $('.mark .form_item').eq(i).parent().find('a').prop("onclick",null).off("click");
                            $('head').append('<style>#startone'+ formItemId +' .star_score a:hover {\n' +
                                '        background: none;\n' +
                                '    }</style>')
                        }

                    }
                }
                //声明下下拉框控件START联动功能
                if($('select[data-type=select]').length != 0){
                    restoreFlag = true;
                    initSelect();
                    $("option").each(function(index){
                        var text_index=$(this).text().indexOf("|");
                        if(text_index > 0) {
                            $(this).text($(this).text().substring(0,text_index));
                        }
                    });
                }
                //声明下签章、手写控END
                fromDataReject = buildFormData();
                var obj = data.object;
                runId = obj.flowRun.runId;
                flowrunId = obj.flowRun.runId;
                $('#uprunId').val(flowrunId)
                globalData.obj = obj;
                globalData.flowRun = obj.flowRun;
                globalData.isViewPriv = obj.isViewPriv;
                globalData.listFp = obj.listFp;
                globalData.listTurnPriv = obj.listTurnPriv;
                globalData.flowRunPrcs = obj.flowRunPrcs;
                globalData.option = option;
                globalData.listView = obj.listView;
                globalData.flowTypeModel = obj.flowTypeModel;
                globalData.conditionDesc = obj.conditionDesc;
                globalData.prcsIn = obj.prcsIn;
                globalData.flowProcesses = obj.flowProcesses;
                globalData.prcsInSet = obj.prcsInSet;
                globalData.prcsOut = obj.prcsOut;
                globalData.prcsType = obj.flowProcesses.prcsType;
                globalData.prcsOutSet = obj.prcsOutSet;
                globalData.gatherNodePriv = obj.gatherNodePriv;
                globalData.topDefault = obj.flowProcesses.topDefault;
                globalData.userName = obj.userName;
                globalData.autoEdit = obj.isWorkName;
                globalData.checkTurnPriv = obj.checkTurnPriv
                globalData.feedback = obj.feedback
                globalData.flowPrcs=obj.flowRunPrcs.flowPrcs
                globalData.flowFormType = obj.flowFormType
                globalData.prcsUser = obj.flowProcesses.prcsUser
                globalData.prcsName = obj.flowProcesses.prcsName

                if(globalData.flowFormType.formName == "年度工作实绩汇报"){
                    $('#DATA_32').on('input propertychange',function(){
                        if($(this).val().length>2000) {
                            // $(this).val($(this).val().substr(0,2000));
                            alert('输入文字不得超过2000个字！')
                        }
                    })
                }
                if ($('#foot_rig').css('display') == 'block') {
                    checkOptionButton()
                }
                var flowName = globalData.flowTypeModel.flowName || '';

                /**************判断 工作流设置了关联应用设置 开始******************************/
                if(globalData.flowProcesses.relationFunc != undefined){
                    autodivheight();
                    if($.GetRequest().isNomalType != undefined){
                        var str ='<ul class="clearfix" style="width: 212px;">\n' +
                            '                    <li class="fl active" data-id="1">表单</li>\n' +
                            '                    <li class="fl" style="margin-left: 1px" data-id="2">正文</li>\n' +
                            '                    <li class="fl" style="margin-left: 1px" data-id="3">'+ globalData.flowProcesses.relationFunc.funcName +'</li>\n' +
                            '                </ul>';
                    }else{
                        var str ='<ul class="clearfix">\n' +
                            '                    <li class="fl active" data-id="1">表单</li>\n' +
                            '                    <li class="fl" style="margin-left: 1px" data-id="3">'+ globalData.flowProcesses.relationFunc.funcName +'</li>\n' +
                            '                </ul>';
                    }

                    $('.tabAB').show().html(str);
                    $('.num').css('width','27%')
                    $('.tabAB ul li').click(function () {
                        $(this).siblings().removeClass('active');
                        $(this).addClass('active');
                        if($(this).attr('data-id')==1){
                            try {
                                $(window.parent.document).contents().find("#zw")[0].contentWindow.isSaveOffice();
                            } catch (e) {
                                console.log(e);
                            }
                            $('#a2').show();
                            $('#tab_t').show();
                            $('#content_module').css('margin-bottom','80px');
                            $('.other_module').show();
                            $('.officialDocument').hide();
                            $("#zw").hide();
                        }else if($(this).attr('data-id')==2){
                            $("#zw").show();
                            $('#content_module').css('margin-bottom','52px');
                            $('.other_module').hide();
                            var tabId = $.GetRequest().tabId||'';
                            var tableName = $.GetRequest().tableName|| '';
                            if(tabId != ''){
                                autodivheight();
                                $.ajax({
                                    url:'/syspara/selectTheSysPara?paraName=OFFICE_EDIT',
                                    type:'post',
                                    datatype:'json',
                                    success: function (res) {
                                        if(res.flag){
                                            if(res.object[0].paraValue == 0){
                                                //默认加载NTKO插件 进行跳转
                                                $('#zw').prop('src','/common/ntko?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag);
                                            }else{
                                                $('#zw').prop('src','/common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag);
                                            }
                                        }else{
                                            $('#zw').prop('src','/common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag);
                                        }
                                    },
                                    error:function(xhr){
                                        $('#zw').prop('src','/common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&tabId='+tabId+'&tableName='+tableName+'&runId='+runId+'&opflag='+opflag);
                                    }
                                })
                            }
                            $('#a2').hide();
                            $('#tab_t').hide();
                            $('.officialDocument').show()
                            $("#zw").contents().find("object").show();

                        } else if($(this).attr('data-id')==3){
                            try {
                                $(window.parent.document).contents().find("#zw")[0].contentWindow.isSaveOffice();
                            } catch (e) {
                                console.log(e);
                            }
                            $('#a2').hide();
                            $('#tab_t').hide();
                            $('.officialDocument').show()
                            $("#zw").show();
                            $('#zw').prop('src',globalData.flowProcesses.relationFunc.funcUrl);
                        }
                    });
                }
                /**************判断 工作流设置了关联应用设置 结束******************************/
                if (!$('#foot_rig').is(':hidden')) {
                    /**************判断 更多操作按钮 开始******************************/
                    var flowAction = globalData.flowTypeModel.flowAction;
                    if (flowAction != '' && flowAction != undefined) {
                        if (flowAction.indexOf('4') == -1 && flowAction.indexOf('5') == -1) {
                            $('#more').hide();
                        }
                        if (flowAction.indexOf('4') == -1) {
                            $('#guidang').hide();
                            $('#foot_rig').show(0, function () {
                                checkOptionButton()
                            });
                            var height = $('.floatRight').height() + 10;
                            $('.floatRight').css({
                                'top': '-' + height + 'px'
                            })
                        } else if (flowAction.indexOf('5') == -1) {
                            $('#daochu').hide();
                            $('#foot_rig').show(0, function () {
                                checkOptionButton()
                            });
                            var height = $('.floatRight').height() + 10;
                            $('.floatRight').css({
                                'top': '-' + height + 'px'
                            })
                        }
                    } else {
                        $('#more').show();
                        $('#guidang').hide();
                        $('#daochu').hide();
                        $('#foot_rig').show(0, function () {
                            checkOptionButton()
                        });
                        var height = $('.floatRight').height() + 10;
                        $('.floatRight').css({
                            'top': '-' + height + 'px'
                        })
                    }
                    /**************判断 更多操作按钮 结束*****************************/
                }
                /**************判断 更多操作按钮 结束*****************************/
                $('#level').val(obj.flowRun.workLevel);
                if(globalData.flowProcesses.prcsItem.indexOf('[C@]') == -1){
                    $('#level').attr('disabled',true)
                }

                flowPrcs =  data.object.flowRunPrcs.flowPrcs;
                allprcsUserlist = option.allprcsUserlist
                prcsPrivlist = option.prcsPrivlist;
                prcsUserlist = option.prcsUserlist;
                prcsDeptlist = option.prcsDeptlist;
                feedback = data.object.feedback;
                attachPriv = data.object.attachPriv;
                if(checkttachPriv(1)){
                    $('.addFujianBox').show();
                }else{
                    $('.addFujianBox').hide();
                }
                allowBack = data.object.allowBack;
                signlock = data.object.signlock;
                countersign = data.object.flowProcesses.countersign;
                countersignAgain = data.object.flowProcesses.countersignAgain;
                opaddUser = globalData.flowRunPrcs.opaddUser;
                if(feedback == '1'){
                    $('#signText').attr("disabled","disabled").parent().hide()
                    $('#signSendBtn').hide()
                    $('#signBtn').hide()
                }

                //判断经办人是否可以加签
                if(countersign == 1){
                    //判断  是否允许增加的经办人加签
                    if (opaddUser == undefined || opaddUser == ''){
                        $('.add_sign').show();
                    }else{
                        if (countersignAgain == '1'){
                            $('.add_sign').show();
                        }
                    }
                }else {
                    if (opaddUser != undefined && opaddUser !='' && countersignAgain == '1'){
                        $('.add_sign').show();
                    }
                }
                $('.add_sign').click(function(){
                    if (!!$('#foot_rig').is(':hidden')) {
                        var loadingIndex = layer.load();
                        saveFormSign(loadingIndex, function () {
                            layer.close(loadingIndex);
                            layer.open({
                                type: 1,
                                offset: '80px',
                                area: ['600px', '400px'],
                                closeBtn: 2,
                                title: '<span style="color: #fff;">增加经办人</span>',
                                content: '<div class="modal-body" style=""><div>' +
                                    '<textarea readonly disabled name="sign" id="sign" user_id="" style="width: 80%;height: 80px;"></textarea><a href="javascript:;" class="choose" style="color: #1687cb;padding:0px 10px">选择</a><a href="javascript:;" style="color: #1687cb;" class="empty">清空</a>' +
                                    '<div style="margin-top: 20px;border: 1px solid #e1e1e8;border-radius: 6px"><div class="signmsg" style="line-height: 32px;background-color: #f3f3f3;border-bottom:1px solid #e1e1e8;font-weight:bold;padding-left: 10px;">当前办理人信息</div>' +
                                    // '<div style="padding-left: 10px;color:red;line-height:28px">加签人：<span class="zUser">'+globalData.flowRunPrcs.userName+'</span></div>'+
                                    '<div style="padding-left: 10px;color:green;line-height:28px"><span class="signUser"></span></div>' +
                                    '</div>' +
                                    '</div></div>',
                                btn: ['<fmt:message code="main.th.confirm" />', '<fmt:message code="depatement.th.quxiao" />'],
                                success: function (layero, index) {
                                    $.ajax({
                                        url: '/workflow/work/getFlowRunPrecsUser',
                                        dataType: 'json',
                                        type: 'get',
                                        data: {
                                            runId: runId,
                                            prcsId: globalData.flowRunPrcs.prcsId,
                                            flowPrcs: prcsId
                                        },
                                        success: function (res) {
                                            if (res.flag) {
                                                if (res.object.length > 0) {
                                                    var str = '' + globalData.flowRunPrcs.userName + '，'
                                                    for (var i = 0; i < res.object.length; i++) {
                                                        str += '<span class="signUsers">' + res.object[i].userName + '，</span>'
                                                    }
                                                    $('.signUser').html(str)
                                                }
                                            }
                                        }
                                    })


//                                    选择会签人
                                    $('.choose').click(function () {
                                        user_id = 'sign'
                                        selectUserLayerIndex = layer.open({
                                            title: '<span style="color: #fff;">选择用户</span>',
                                            type: 2,
                                            content: '/common/selectUser_iframe?isIframeOpen=1&&selectUserLayerIndex=selectUserLayerIndex', // 专用iframe打开的选人控件页面
                                            area: ['60%', '70%']
                                        });
                                        // $.popWindow("../../common/selectUser");
                                    })

//                                    清空会签人
                                    $('.empty').click(function () {
                                        $('#sign').val('')
                                        $('#sign').attr('user_id', '')
                                    })

                                },
                                yes: function (index, layero) {
                                    var textVal = $('#sign').val()
                                    var str = ""
                                    $('.signUsers').each(function (i, v) {
                                        if (textVal.indexOf($(this).html().replace('，', '')) > -1) {
                                            str += $(this).html()
                                        }
                                    })
                                    if (textVal.indexOf($('.zUser').html()) > -1) {
                                        str += $('.zUser').html() + ','
                                    }

                                    /*if(str != ""){//暂时注释允许重复添加经办人
                                     alert('['+str+']已经是本步骤的办理人不需要添加')
                                     return false;
                                     } else*/
                                    if (!$('#sign').attr('user_id')) {
                                        alert('请选择经办人');
                                        return false;
                                    } else {
                                        var index = layer.load(1);
                                        $.ajax({
                                            url: '/workflow/work/addFeedback',
                                            data: {
                                                runId: runId,
                                                flowId: flowId,
                                                flowPrcs: prcsId,
                                                prcsId: globalData.flowRunPrcs.prcsId,
                                                runName: globalData.flowRun.runName,
                                                userId: $('#sign').attr('user_id'),
                                                topFlag: globalData.flowRunPrcs.topFlag
                                            },
                                            success: function (res) {
                                                if (res.flag) {
//                                                    $.layerMsg({content:'添加成功',icon:1})
//                                                    layer.closeAll()
                                                    $.ajax({
                                                        url: '/workflow/work/getFlowRunPrecsUser',
                                                        dataType: 'json',
                                                        type: 'get',
                                                        data: {
                                                            runId: runId,
                                                            prcsId: globalData.flowRunPrcs.prcsId,
                                                            flowPrcs: prcsId
                                                        },
                                                        success: function (datas) {
                                                            if (datas.flag) {
                                                                $.layerMsg({content: '添加成功', icon: 1})
                                                                layer.closeAll();
                                                                window.location.reload();
                                                            }
                                                        }
                                                    })
                                                } else {
                                                    $.layerMsg({content: '添加失败', icon: 2})
                                                }
                                            }
                                        })

                                    }


                                }
                            });
                        });
                    } else { // 主办人办理
                        saveFlowData(function (data) {
                            layer.open({
                                type: 1,
                                offset: '80px',
                                area: ['600px', '400px'],
                                closeBtn: 2,
                                title: '<span style="color: #fff;">增加经办人</span>',
                                content: '<div class="modal-body" style=""><div>' +
                                    '<textarea readonly disabled name="sign" id="sign" user_id="" style="width: 80%;height: 80px;"></textarea><a href="javascript:;" class="choose" style="color: #1687cb;padding:0px 10px">选择</a><a href="javascript:;" style="color: #1687cb;" class="empty">清空</a>' +
                                    '<div style="margin-top: 20px;border: 1px solid #e1e1e8;border-radius: 6px"><div class="signmsg" style="line-height: 32px;background-color: #f3f3f3;border-bottom:1px solid #e1e1e8;font-weight:bold;padding-left: 10px;">当前办理人信息</div>' +
                                    // '<div style="padding-left: 10px;color:red;line-height:28px">加签人：<span class="zUser">'+globalData.flowRunPrcs.userName+'</span></div>'+
                                    '<div style="padding-left: 10px;color:green;line-height:28px"><span class="signUser"></span></div>' +
                                    '</div>' +
                                    '</div></div>',
                                btn: ['<fmt:message code="main.th.confirm" />', '<fmt:message code="depatement.th.quxiao" />'],
                                success: function (layero, index) {
                                    $.ajax({
                                        url: '/workflow/work/getFlowRunPrecsUser',
                                        dataType: 'json',
                                        type: 'get',
                                        data: {
                                            runId: runId,
                                            prcsId: globalData.flowRunPrcs.prcsId,
                                            flowPrcs: prcsId
                                        },
                                        success: function (res) {
                                            if (res.flag) {
                                                if (res.object.length > 0) {
                                                    var str = '' + globalData.flowRunPrcs.userName + '，'
                                                    for (var i = 0; i < res.object.length; i++) {
                                                        str += '<span class="signUsers">' + res.object[i].userName + '，</span>'
                                                    }
                                                    $('.signUser').html(str)
                                                }
                                            }
                                        }
                                    })


//                                    选择会签人
                                    $('.choose').click(function () {
                                        user_id = 'sign'
                                        selectUserLayerIndex = layer.open({
                                            title: '<span style="color: #fff;">选择用户</span>',
                                            type: 2,
                                            content: '/common/selectUser_iframe?isIframeOpen=1&&selectUserLayerIndex=selectUserLayerIndex', // 专用iframe打开的选人控件页面
                                            area: ['60%', '70%']
                                        });
                                        // $.popWindow("../../common/selectUser");
                                    })

//                                    清空会签人
                                    $('.empty').click(function () {
                                        $('#sign').val('')
                                        $('#sign').attr('user_id', '')
                                    })

                                },
                                yes: function (index, layero) {
                                    var textVal = $('#sign').val()
                                    var str = ""
                                    $('.signUsers').each(function (i, v) {
                                        if (textVal.indexOf($(this).html().replace('，', '')) > -1) {
                                            str += $(this).html()
                                        }
                                    })
                                    if (textVal.indexOf($('.zUser').html()) > -1) {
                                        str += $('.zUser').html() + ','
                                    }

                                    /*if(str != ""){//暂时注释允许重复添加经办人
                                     alert('['+str+']已经是本步骤的办理人不需要添加')
                                     return false;
                                     } else*/
                                    if (!$('#sign').attr('user_id')) {
                                        alert('请选择经办人');
                                        return false;
                                    } else {
                                        var index = layer.load(1);
                                        $.ajax({
                                            url: '/workflow/work/addFeedback',
                                            data: {
                                                runId: runId,
                                                flowId: flowId,
                                                flowPrcs: prcsId,
                                                prcsId: globalData.flowRunPrcs.prcsId,
                                                runName: globalData.flowRun.runName,
                                                userId: $('#sign').attr('user_id'),
                                                topFlag: globalData.flowRunPrcs.topFlag
                                            },
                                            success: function (res) {
                                                if (res.flag) {
//                                                    $.layerMsg({content:'添加成功',icon:1})
//                                                    layer.closeAll()
                                                    $.ajax({
                                                        url: '/workflow/work/getFlowRunPrecsUser',
                                                        dataType: 'json',
                                                        type: 'get',
                                                        data: {
                                                            runId: runId,
                                                            prcsId: globalData.flowRunPrcs.prcsId,
                                                            flowPrcs: prcsId
                                                        },
                                                        success: function (datas) {
                                                            if (datas.flag) {
                                                                $.layerMsg({content: '添加成功', icon: 1})
                                                                layer.closeAll();
                                                                window.location.reload();
                                                            }
                                                        }
                                                    })
                                                } else {
                                                    $.layerMsg({content: '添加失败', icon: 2})
                                                }
                                            }
                                        })

                                    }


                                }
                            });
                        });
                    }
                });


                if(allowBack != 0){
                    $("#goback").show();
                    $("#goback").attr("allowBack",allowBack);
                    $("#goback").click(function () {
                        gobackIndex = 1;
                        saveFlowData(function(data){
                            if(data.flag){
                                $.layerMsg({content:'保存成功！',icon:1},function(){
                                    $.ajax({
                                        type: "get",
                                        url: "getflowprcsdata",
                                        dataType: 'JSON',
                                        data: {
                                            prcsId: flowStep,
                                            runId: runId,
                                            allowBack:$('#goback').attr('allowback')
                                        },
                                        success: function (res) {
                                            if(res.flag){
                                                var feedbackLiObj = "";
                                                res.obj.forEach(function(v,i){
                                                    feedbackLiObj += '<li><input type="radio" name="feedbackstep" class="" flowPrcs="'+v.flowProcess.prcsId+'" id="'+v.id+'"><span class="feedbacktitle"><fmt:message code="workflow.th.First" />'+v.prcsId+'<fmt:message code="workflow.th.step" />'+v.flowProcess.prcsName+'</span><div class="feedbackcontent"><fmt:message code="sup.th.Sponsor" />：'+v.userName+'&nbsp;&nbsp;&nbsp;<fmt:message code="workflow.th.Settlingtime" />：'+v.prcsTime+'</div></li>';
                                                });
                                                layer.open({
                                                    type: 1,
                                                    offset: '80px',
                                                    area: ['800px', '500px'],
                                                    closeBtn: 2,
                                                    title: '<span style="color: #fff;">'+titleName+'</span>',
                                                    content: '<div class="modal-body" style="">' +
                                                        '<div class="work-prcs-title" id="op_user_show_info" style="margin-bottom: 10px;font-weight: normal;border-radius: 4px;-webkit-border-radius: 4px;">' +
                                                        '<fmt:message code="document.th.SelectReturnStep" />：' +
                                                        '</div><div class="work-prcs-block">' +
                                                        '<div class="work-prcs-content clearfix" style="border: 1px solid #f3f3f3;"><div class=" workflow-procs-nodes-result-wrap">' +
                                                        '<ul id="work-next-prcs-block" class="workflow-procs-nodes-result" style="top: 0px; margin-left: 30px;word-spacing: 0px;">' +feedbackLiObj+
                                                        //'</ul></div></div></div><div class="work-msg-block">' +
                                                        //'<div class="work-msgselectUser-title"><a id="msg-control" href="#"><img style="vertical-align: text-top; margin-top: 5px;" src="../../img/workflow/work/add_work/form_down.png"></a> <fmt:message code="document.th.InputReturnOpinion" />：</div>' +
                                                        //'<div class="work-msg-content" style="display: block;"><div class="clearfix"><textarea id="feedback" class="backinfo"></textarea>' +
                                                        //'</div></div></div></div>',
														'</ul></div></div></div></div>',
                                                    btn: ['<fmt:message code="main.th.confirm" />', '<fmt:message code="depatement.th.quxiao" />'],
                                                    success: function (layero, index) {

                                                    },
                                                    yes: function(index, layero){

                                                        var feedback = $('#feedback').val();
                                                        var backflowPrcs = $("input[name='feedbackstep']:checked").attr('flowPrcs');
                                                        if(backflowPrcs == undefined){
                                                            alert('<fmt:message code="main.th.FallbackStep" />！')
                                                            return false;
                                                        }
                                                        if(feedback == ''){
                                                            alert('<fmt:message code="main.th.ReturnOpinion" />！')
                                                            return false;
                                                        }
                                                        layer.load();
                                                        $.ajax({
                                                            type: "get",
                                                            url: "insertprcsdata",
                                                            dataType: 'JSON',
                                                            data: {
                                                                id:globalData.flowRunPrcs.id,
                                                                backId:$("input[name='feedbackstep']:checked").attr('id'),
                                                                flowPrcs : backflowPrcs,
                                                                prcsId : prcsId,
                                                                flowStep:flowStep,
                                                                runId : runId,
                                                                feedback : $('#feedback').val(),
                                                                tableName:tableName,
                                                                tabId:tabId
                                                            },
                                                            success: function (res) {
                                                                if(res.flag){
                                                                    $.layerMsg({content:'<fmt:message code="document.th.RollbackSuccessful" />！',icon:1},function(){
                                                                        //window.close();
																		window.history.go(-1);
                                                                        /*if (parent.opener.runWorkListPage) {
                                                                            parent.opener.runWorkListPage();
                                                                        }
                                                                        if (parent.opener.openRold) {
                                                                            parent.opener.openRold()
                                                                        }*/
																		
																		
                                                                    });
                                                                }else{
                                                                    $.layerMsg({content:'<fmt:message code="document.th.RollbackFailed" />！',icon:2},function(){
//                                                            layer.closeAll();
                                                                    });
                                                                }
                                                            }
                                                        });
                                                    }
                                                });
                                            }else{
                                                $.layerMsg({content:'<fmt:message code="document.th.RollbackFailed" />！',icon:2},function(){

                                                });
                                            }
                                        },
                                        error:function(res){
                                            $.layerMsg({content:'<fmt:message code="document.th.RollbackFailed" />！',icon:2},function(){

                                            });
                                        }
                                    });
                                });
                            }else{
                                $.layerMsg({content:'保存失败！',icon:2},function(){

                                });
                            }
                        });

                    });
                }
                initSlideBar(prcsId,flowStep,runId);
                var obj=data.object.flowRun;

                if(globalData.autoEdit == 0){
                    var titleName= 'NO.&nbsp'+obj.runId+'&nbsp;'+obj.runName;
                }else if(globalData.autoEdit == 1){
                    var titleName= 'NO.&nbsp'+obj.runId+'&nbsp;<input type="text" class="runname" value="' +obj.runName+ '" style="width: 300px;font-size: 14px;">';
                }

                $('.num').html(titleName).attr({'title':'NO.'+obj.runId+' '+obj.runName,thisrunName:obj.runName});
                var obj2 = [];
                $('.step').html('<fmt:message code="workflow.th.host" />：(<fmt:message code="workflow.th.First" />'+flowStep+'<fmt:message code="workflow.th.step" />：'+globalData.flowProcesses.prcsName+')');
                var tablelength = $('#a2 table').length;
                var max = [];
                var thiswidth;
                if(tablelength != 0){
                    for(var i=0;i<tablelength;i++){
                        max.push($('#a2 table').eq(i).width());
                    }
                    for(var i=0;i<max.length;i++){
                        if(max[i] > max[i+1]){
                            thiswidth = max[i+1];
                            max[i+1] = max[i];
                            max[i] = thiswidth;
                        }
                    }
                    var maxtablewidth = max[max.length-1];
                    if($('body').width() < maxtablewidth){
                        $('.content').width(maxtablewidth+200);
                    }
                }

                /*************处理radio类型input在disabled下无法修改样式的问题 通过将已选中的radio 去除掉disabled解决 仅限于工作流-办理页面******************/
                var length = $('input[type=radio]').length;
                if(length != 0){
                    for(var i=0;i<length;i++){
                        if($('input[type=radio]').eq(i).attr('checked') == 'checked'){
                            $('input[type=radio]').eq(i).removeAttr('disabled');
                        }
                    }
                }

                /*************处理工作流表单过长，在表单设计器声明特殊标签进行控制START******************/
                if($('.splitBox').length > 0){
                    $('head').append('<style>' +
                        '.splitTab li {\n' +
                        '    display: inline-block;\n' +
                        '    height: 45px;\n' +
                        '    min-width: 90px;\n' +
                        '}' +
                        '.active {\n' +
                        '    background: #3c92e5 !important;\n' +
                        '    border-radius: 4px;\n' +
                        '    color: #fff !important;\n' +
                        '}' +
                        '.head_title {\n' +
                        '    cursor:pointer;\n' +
                        '    display: inline-block;\n' +
                        '    margin: 7px 10px;\n' +
                        '    padding: 0 10px;\n' +
                        '    height: 30px;\n' +
                        '    line-height: 30px;\n' +
                        '    text-align: center;\n' +
                        '    font-size: 10pt;\n' +
                        '    border: 1px solid #3c92e5;\n' +
                        '    border-radius: 4px;\n' +
                        '    color: #3c92e5;\n' +
                        '}' +
                        '.head_title:hover {\n' +
                        '    border: 1px solid #3b8eef;\n' +
                        '    color: #ffffff;\n' +
                        '    background-color: #3b8eef;\n' +
                        '    background-image: -moz-linear-gradient(top, #3b8eef, #3b8eef);\n' +
                        '    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3b8eef), to(#3b8eef));\n' +
                        '    background-image: -webkit-linear-gradient(top, #3b8eef, #3b8eef);\n' +
                        '    background-image: -o-linear-gradient(top, #3b8eef, #3b8eef);\n' +
                        '    background-image: linear-gradient(to bottom, #3b8eef, #3b8eef);\n' +
                        '    background-repeat: repeat-x;\n' +
                        '    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'#3b8eef\', endColorstr=\'#3b8eef\', GradientType=0);\n' +
                        '    filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);\n' +
                        '}' +
                        '.splitTab{    ' +
                        '    width: 100%;\n' +
                        '    height: 50px;\n' +
                        '    position: fixed;\n' +
                        '    top: 45px;\n' +
                        '    z-index: 10000;\n' +
                        '    background: #fff;\n' +
                        '    display: none;' +
                        '}</style>'
                    );
                    var str = '';
                    for(var i=0;i<$('.splitItem').length;i++){
                        var val = $('.splitItem').eq(i).attr('value');
                        str += '<li><span class="head_title">'+ val +'</span></li>'
                    }
                    if($('.splitItem').length > 0){
                        str += '<li><span class="head_title all">显示全部</span></li>'
                    }
                    $('.splitTab').html(str).show();
                    $('.splitBox').hide().eq(0).show();
                    $('.splitTab li span').eq(0).addClass('active');
                    var firstPrcsItem = globalData.flowProcesses.prcsItem.split(',')[0];
                    if(globalData.flowProcesses.prcsItem.split(',')[0] == '[A@]'){
                        firstPrcsItem = globalData.flowProcesses.prcsItem.split(',')[1];
                    }
                    var firstPrcsItemNum = $('.form_item[title='+ firstPrcsItem +']').parents('.splitBox').index();
                    $('.splitTab').on('click','li',function(){
                        $(this).siblings().find('span').removeClass('active');
                        $(this).find('span').addClass('active');
                        if($(this).find('span').hasClass('all')){
                            $('.splitBox').show();
                        }else{
                            var num =  $(this).index();
                            $('.splitBox').eq(num).show().siblings().hide();
                        }
                    });
                    $('.splitTab li').eq(firstPrcsItemNum).click();
                }
                /**************************************END*****************************************/

                /*************设置表单下列表与表单宽度一致START***************/
                var formWidth = $('.cont_form').find('.firstRow').parents('table').width();
                $('.other_module_box').width(formWidth);
                /*************设置表单下列表与表单宽度一致END***************/
            }
        });
        // 更多操作 归档
        $('#guidang').click(function () {
            var $url=window.location.href.split('?')[1];
            var $html=$('<div id="ifDiv" style="display:none;">' +
                '<iframe src="/workflow/work/workformPreView?'+$url+'" frameborder="0"></iframe>' +
                '</div>')
            $('body').append($html)
            var l = $('#ifDiv iframe'),a=null;
            var f = setInterval(function(){
                try{
                    a = l.contents().find("#client").html();

                }catch(i){

                    clearInterval(f);
                }
                if(a){
                    clearInterval(f);
                    openFile(a)
                }
            },300);
        });
        // 更多操作-导出
        $('#daochu').click(function () {
            var $url=window.location.href.split('?')[1];
            var $html=$('<div id="ifDiv" style="display:none;">' +
                '<iframe src="/workflow/work/workformPreView?'+$url+'" frameborder="0"></iframe>' +
                '</div>')
            $('body').append($html)
            var l = $('#ifDiv iframe'),a=null;
            var f = setInterval(function(){
                try{
                    a = l.contents().find("#client").html();

                }catch(i){
                    clearInterval(f);
                }
                if(a){
                    clearInterval(f);
                    openFiledaochu(a)
                }
            },300);

        });
        // 更多操作-内部邮件
        $('#email').click(function () {
            saveFlowData(function(data){
                var url = '/workflow/work/workformPreView?'+location.href.split('workform?')[1]+'&type=email';
                window.open(url);
            },'noCheck');
        });
        // 更多操作-分享公告
        $('#notice').click(function () {
            saveFlowData(function(data){
                var url = '/workflow/work/workformPreView?'+location.href.split('workform?')[1]+'&type=notice';
                window.open(url);
            },'noCheck');

        });
        // 更多操作-转存
        $('#shareSave').click(function () {
            saveFlowData(function(data){
                var url = '/workflow/work/workformPreView?'+location.href.split('workform?')[1]+'&type=share';
                window.open(url);
            },'noCheck');

        });
        $('#fenxiang').click(function(){
            window.open("/workflow/work/notifyWork?flowId="+flowId+"&type=todo&prcsId="+prcsId+"&flowStep="+flowStep+"&runId="+runId);
        });
        $('.rig_h1one').click(function(){
            $('.floatRight').toggle();
        });
        //更多操作设置按钮切换显示
        $('.rig_h1one1').click(function(){
            $('.floatRight1').toggle();
        });
        $('#cancleBtn').click(function(){
            var r = confirm("是否保存此工作？")
            if (r==true){
                saveFlowData(function(data){
                    if(data.flag){
                        $.layerMsg({content:'保存成功！',icon:1},function(){

                        });
                    }else{
                        $.layerMsg({content:'保存失败！',icon:2},function(){

                        });
                    }
                    //window.close();
					window.history.go(-1);
                    if(parent.opener.openRold!=undefined){
                        parent.opener.openRold()
                    }
                    if(parent.opener.runWorkListPage!=undefined){
                        parent.opener.runWorkListPage();
                    }
                });
            }else{
                if(type == 'new'){
                    $.ajax({
                        type: "get",
                        url: "deleteRunPrcs",
                        dataType: 'JSON',
                        data: {
                            id:globalData.flowRunPrcs.id
                        },
                        success: function (obj) {
                            //window.close();
							window.history.go(-1);
                            if(parent.opener.openRold!=undefined){
                                parent.opener.openRold()
                            }
                        }
                    });
                }else{
                    //window.close();
					window.history.go(-1);
                    if(parent.opener.openRold!=undefined){
                        parent.opener.openRold()
                    }
                }
            }

        });
        $('#oneUploadFile').delegate('.downloadBtn','click',function () {
            var _this = $(this);
            if(checkttachPriv(4)){
                var url = _this.attr("atturl")
//                    alert("../../download?"+url);
                window.open("../../download?"+url);
            }else{
                $.layerMsg({content:'<fmt:message code="document.th.permissionDownload" />！',icon:6},function(){
                });
            }
        });
        $('#oneUploadFile').on('click','.deletefileBtn',function () {
            var _this = $(this);
            var url =  'deletework?runId='+runId+'&'+_this.attr("atturl");
            $.layerConfirm({title:'<fmt:message code="menuSSetting.th.suredeleteMenu" />',content:'<fmt:message code="workflow.th.que" />？',icon:0},function(){
                $.get(url,function(data,status){
                    if(data.flag){
                        $.layerMsg({content:'<fmt:message code="workflow.th.delsucess" />！',icon:1},function(){
                        });
                        var pIndex = _this.parent().parent().index();
                        _this.parent().parent().remove();
                        $('#flowFilesTBody').find('tr').eq(pIndex).remove();
                        if($('#oneUploadFile li').length == 0){
                            $('#oneUploadFile').hide();
                            $('#img_none').show();
                            $('#flowFiles').hide();
                        }
                    }else{
                        $.layerMsg({content:'<fmt:message code="lang.th.deleSucess" />！',icon:2},function(){

                        });
                    }
                });
            },function(){

            });
        });
        $('#oneUploadFile').on('click','.previewBtn',function () {
            var _this = $(this);
            var atturl = _this.attr("atturl");
            if($.UrlGetRequest('?'+atturl) != 'doc'&&$.UrlGetRequest('?'+atturl) != 'docx'&&$.UrlGetRequest('?'+atturl) != 'xls'&&$.UrlGetRequest('?'+atturl) != 'xlsx'&&$.UrlGetRequest('?'+atturl) != 'ppt'&&$.UrlGetRequest('?'+atturl) != 'pptx'&&$.UrlGetRequest('?'+atturl) != 'wps'){
                var fomat = atturl.split('&ATTACHMENT_NAME=')[1];
                var index = fomat .lastIndexOf("\.");
                fomat  = fomat .substring(index + 1, fomat .length);

            }else{
                var fomat = $.UrlGetRequest('?'+atturl);
            }
            pdurl(fomat,atturl);
        });
        $('#oneUploadFile').on('click','.editBtn',function () {
            var _this = $(this);
            var atturl = _this.attr("atturl");

            if(checkttachPriv(2)){
                $.popWindow("../../common/webOffice?documentEditPriv=1&ntType=1&emailList=1&print=1&"+atturl,'<fmt:message code="main.th.PreviewPage" />','0','0','1500px','800px');
            }else{
                $.layerMsg({content:'<fmt:message code="document.th.HaveEditRights" />！',icon:6},function(){

                });
            }
        });
        $('#print').click(function(){

            window.open('workformPreView?flowId='+ flowId +'&prcsId='+ prcsId +'&flowStep='+ flowStep +'&runId='+runId)
        });
        //选择意见
        $("#signBtn").click(function() {
            var signChooseLayer = layer.open({
                title:'<span style="color: #fff;">选择常用意见</span>',
                area: ['800px', '600px'],
                type: 1,
                content: '<div id="saveRule" >' +
                    '<div class="layui-form-item" style="margin: 10px 0 0 0;">' +
                    '<label class="layui-form-label" style="font-size: 13px; width: 100px;">添加常用意见：</label>' +
                    '<div class="layui-input-block" style="margin-left: 130px;">' +
                    '<input type="text" id="yijian" style="width: 300px" ><button type="button" style="font-size: 13px" class="add_fujianss" id="add">添加</button>' +
                    '<a style="margin-left:30px;margin-top:-13px;color:red;font-size: 13px;cursor:pointer;text-decoration: none;" id="up">删除常用意见</a>' +
                    '</div>' +
                    '</div>' +
                    '<div class="inputlayout" style="height: 440px; overflow: hidden;">' +
                    '<ul class="input_radio_box" style="height: 100%; overflow-y: auto;"></ul>'+
                    '</div>' +
                    '<hr>' +
                    '<div style="text-align: center;">' +
                    '<button type="button" style="margin: 0 10px;font-size: 13px" class="add_fujians" id="yes">选择</button>' +
                    '<button type="button" style="margin: 0 10px;font-size: 13px" class="add_fujians" id="cancle">取消</button>' +
                    '</div>'+
                    '</div>'

                ,
                // btn: [sure, cancel],
                success: function(){
                    $.get('/flowOpinion/selectFlowOpinion',function(res){
                        var data=res.object
                        if (res.flag) {
                            if (res.object.length > 0) {
                                var str = ''
                                for (var i = 0; i < data.length; i++) {
                                    str += '<li class="clearfix" style="font-size: 13px;line-height: 20px;padding: 0 10px;"><input style="margin: -2px 5px 0 15px;" class="tableDl " id="flowId" data-id="' + data[i].opinionId + '"  type="radio" name="flowId" value="' + data[i].opinionContent + '" >' + data[i].opinionContent + '</li>'
                                }
                                $('.input_radio_box').html(str);
                            }
                        }
                    });
                }
            })

            //数据回显
            $("#yes").click(function(event) {
                var opinionContent =$('input[name="flowId"]:checked').val()

                $("#signText").val(opinionContent);
                layer.closeAll()

            })

            //添加意见
            $("#add").click(function(event) {
                var content = document.getElementById("yijian").value

                $.ajax({
                    type: 'post',
                    url: '/flowOpinion/insertFlowOpinion',
                    dataType: 'json',
                    data: {
                        opinionContent: content,
                        opinionType:1,

                    },
                    success: function (res) {
                        if (res.flag) {
                            $.get('/flowOpinion/selectFlowOpinion',function(res){
                                var data=res.object
                                if (res.flag) {
                                    if (res.object.length > 0) {
                                        var str = ''
                                        for (var i = 0; i < data.length; i++) {
                                            str += '<li class="clearfix" style="font-size: 13px;line-height: 20px;padding: 0 10px;"><input style="margin: -2px 5px 0 15px;" class="tableDl " id="flowId" data-id="' + data[i].opinionId + '"  type="radio" name="flowId" value="' + data[i].opinionContent + '" >' + data[i].opinionContent + '</li>'
                                        }
                                        $('.input_radio_box').html(str);
                                    }
                                }
                                $("#yijian").attr("value","");

                            });
                        }
                    }
                })
            })

            //删除意见
            $("#up").click(function () {
                var opinionId = $('input[name="flowId"]:checked').data('id')

                $.layerConfirm({title: '确定删除', content: '您确定要删除吗?', icon: 0}, function () {
                    $.ajax({
                        type: 'post',
                        url: '/flowOpinion/delFlowOpinion',
                        dataType: 'json',
                        data: {
                            opinionId: opinionId,
                        },
                        beforeSend: function (request) {
                            if (beforeToken != '') {
                                request.setRequestHeader("Authorization", 'Bearer ' + beforeToken);
                            }
                        },
                        success: function (res) {
                            if (res.flag) {
                                $.get('/flowOpinion/selectFlowOpinion', function (res) {
                                    var data = res.object
                                    if (res.flag) {
                                        if (res.object.length > 0) {
                                            var str = ''
                                            for (var i = 0; i < data.length; i++) {
                                                str += '<li class="clearfix" style="font-size: 13px;line-height: 20px;padding: 0 10px;"><input style="margin: -2px 5px 0 15px;" class="tableDl" id="flowId" data-id="' + data[i].opinionId + '"  type="radio" name="flowId" value="' + data[i].opinionContent + '" >' + data[i].opinionContent + '</li>'
                                            }
                                            $('.input_radio_box').html(str);
                                        }
                                    }
                                });
                            } else {
                                $.layerMsg({content: '请选择意见', icon: 2})
                            }
                        }
                    })
                })
            })

            // 取消添加意见
            $("#cancle").click(function () {
                layer.close(signChooseLayer)
            })

        });
        //提交
        $("#signSendBtn").click(function() {
            if(checkFeeback()){
                var text = $('#signText').val();
                if(text == ''){
                    $.layerMsg({content:'<fmt:message code="document.th.Countersign" />！',icon:5},function(){

                    });
                    return false;
                }else{
                    $.ajax({
                        type: "get",
                        url: "workfeedback",
                        dataType: 'JSON',
                        data: {
                            prcsId:globalData.flowRunPrcs.prcsId,
                            flowPrcs:flowPrcs,
                            runId:runId,
                            content:text,
                            file:'',
                            feedFlag:'0'
                        },
                        success: function (obj) {
                            $('#signText').val('');
                            initSlideBar(flowPrcs,globalData.flowRunPrcs.prcsId,runId);
                            workForm.option.eleObject.find('.macrossign').each(function(i,v){
                                if($(this).attr('datafld') =='SYS_FLOW_SIGNTEXT'){
                                    if($(this).attr('stepType')!=""&&$(this).attr('stepType')!=undefined){
                                        stepType = $(this).attr('stepType');
                                        stepValue =  $(this).attr('stepValue');
                                        workForm.MacrosRender(true,stepType,stepValue);
                                        workForm.MacrosSignRender(stepType,stepValue);
                                    }
                                }
                            })

                            //下面是兼容通达会签意见代码
                            var arrSign = workForm.option.signText;
                            if(arrSign!=undefined&&arrSign.length>0){
                                var stepType1 = "";
                                var stepValue1 = '';
                                var stepType = "";
                                var stepValue = '';
                                arrSign.forEach(function(v,i){
                                    var sign = v.match(/#\[MACRO_SIGN(\d*)(\*?)\]\[([\S\s]*?)\]/i);
                                    if(sign[2]=='*'){
                                        stepType = 'FLOW_PRCS';
                                        stepValue += sign[1]+',';
                                    }else{
                                        stepType1 = 'PRCS_ID';
                                        stepValue1 += sign[1]+',';
                                    }
                                })
                                if(stepType != ''){
                                    macroSign(stepType,stepValue,'.cont_form');
                                }
                                if(stepType1 != ''){
                                    macroSign(stepType1,stepValue1,'.cont_form');
                                }
                            }
                        }
                    });
                }

            }else{
                $.layerMsg({content:'<fmt:message code="document.th.permissionToCountersign" />！',icon:6},function(){

                });
            }
        });
        //点击会签意见编辑
        $(document).on('click','.edit',function(){

            var id = $(this).parents('li').attr('id');
            var content = $(this).parents('li').find('.cesdiv').html();
            var flowNum = $(this).parents('li').attr('flowNum');
            $(this).addClass('save').removeClass('edit').find('img').attr('src','/img/workflow/work/yes.png');
            $(this).parents('li').find('.area').show();
            $(this).parents('li').find('#signText').val(content);
            $(this).parents('li').find('.cesdiv').hide();

        });
        //点击保存会签意见
        $(document).on('click','.save',function(){
            var id = $(this).parents('li').attr('id');
            var content =  $(this).parents('li').find('#signText').val();
            var prcsId = $(this).parents('li').attr('flowNum');
//                var prcsId = $(this).parents('li').attr('prcsId');
            var flowPrcs = $(this).parents('li').attr('flowPrcs');
            var runId = $(this).parents('li').attr('runId');
            $.ajax({
                url:'/form/updateContent',
                dataType:'json',
                type:'get',
                data:{
                    feedId:id,
                    content:content
                },
                success:function(res){
                    if(res.flag){
                        $(this).parents('li').find('#signText').val('');
                        initSign(prcsId,flowPrcs,runId);
                        getSign(runId);
                        workForm.MacrosRender(true);
                        workForm.MacrosSignRender();
                        //下面是兼容通达会签意见代码
                        // var macrosSign = workForm.option.eleObject[0].innerHTML;
                        var arrSign = workForm.option.signText;
                        // console.log(arrSign)

                        if(arrSign!=undefined&&arrSign.length>0){
                            var stepType1 = "";
                            var stepValue1 = '';
                            var stepType = "";
                            var stepValue = '';
                            arrSign.forEach(function(v,i){
                                var sign = v.match(/#\[MACRO_SIGN(\d*)(\*?)\]\[([\S\s]*?)\]/i);
                                if(sign[2]=='*'){
                                    stepType = 'FLOW_PRCS';
                                    stepValue += sign[1]+',';
                                }else{
                                    stepType1 = 'PRCS_ID';
                                    stepValue1 += sign[1]+',';
                                }
                            })
                            if(stepType != ''){
                                macroSign(stepType,stepValue,'.cont_form');
                            }
                            if(stepType1 != ''){
                                macroSign(stepType1,stepValue1,'.cont_form');
                            }
                        }
                    }
                }
            })
        });
        // 删除会签意见
        $(document).on('click','.del',function(){
            var id = $(this).parents('li').attr('id');
            var prcsId = $(this).parents('li').attr('flowNum');
            var flowPrcs = $(this).parents('li').attr('flowPrcs');
            var runId = $(this).parents('li').attr('runId');
            layer.confirm(' 确定要删除该会签意见吗？', {
                btn: [' <fmt:message  code="global.lang.ok"/>', ' <fmt:message  code="depatement.th.quxiao"/>'], //按钮
                title: " <fmt:message code="common.th.prompt" />"
            },function(){
                $.ajax({
                    url:'/form/deleteContent',
                    dataType:'json',
                    type:'get',
                    data:{
                        feedId:id
                    },
                    success:function(res){
                        if(res.flag){
                            initSign(prcsId,flowPrcs,runId);
                            getSign(runId);
                            workForm.option.eleObject.find('.macrossign').each(function(i,v){
                                if($(this).attr('datafld') =='SYS_FLOW_SIGNTEXT'){
                                    if($(this).attr('stepType')!=""&&$(this).attr('stepType')!=undefined){
                                        stepType = $(this).attr('stepType');
                                        stepValue =  $(this).attr('stepValue');
                                        workForm.MacrosRender(true,stepType,stepValue);
                                        workForm.MacrosSignRender(stepType,stepValue);
                                    }
                                }
                            })
                            //下面是兼容通达会签意见代码
                            // var macrosSign = workForm.option.eleObject[0].innerHTML;
                            var arrSign = workForm.option.signText;
                            if(arrSign!=undefined&&arrSign.length>0){
                                var stepType1 = "";
                                var stepValue1 = '';
                                var stepType = "";
                                var stepValue = '';
                                arrSign.forEach(function(v,i){
                                    var sign = v.match(/#\[MACRO_SIGN(\d*)(\*?)\]\[([\S\s]*?)\]/i);
                                    if(sign[2]=='*'){
                                        stepType = 'FLOW_PRCS';
                                        stepValue += sign[1]+',';
                                    }else{
                                        stepType1 = 'PRCS_ID';
                                        stepValue1 += sign[1]+',';
                                    }
                                })
                                if(stepType != ''){
                                    macroSign(stepType,stepValue,'.cont_form');
                                }
                                if(stepType1 != ''){
                                    macroSign(stepType1,stepValue1,'.cont_form');
                                }
                            }
                            layer.closeAll();
                        }
                    }
                })
            }, function () {
                layer.closeAll();
            })
        });
        $('#add_fujian').click(function () {
            if(checkttachPriv(1)){
                $('#uprunId').val(flowrunId);
                $('#uploadinputimg').click();
            }else{
                $.layerMsg({content:'<fmt:message code="document.th.AttachmentPermission" />！',icon:6},function(){
                });
                return;
            }
        });
        $('#uploadinputimg').change(function(e){
            //预算
            var flowId = workForm.option.flowRun.flowId;
            if(tableName == 'budget'){
                $('#uploadimgform').attr('action','/budget/workUpload?module=workflow&flag=0')
            }

            layer.load();
            $('#uploadimgform').ajaxSubmit({
                type: 'post',
//                    dataType: 'json',
                success: function (res) {
                    res = $.parseJSON(res);
                    if($('#uploadinputimg').val() != ''){
                        if(res.flag){
                            $('#uploadinputimg').val('');
                            var data=res.obj;
                            var str='';
                            var fileStr = '';
                            if(checkttachPriv(2)){
                                var editdisplay = 'display:inline-block;'
                            }else{
                                var editdisplay = 'display: none;'
                            }
                            var deletedisplay = 'display:inline-block;'//可以上传，一定可以删除
                            if(checkttachPriv(4)){
                                var downloaddisplay = 'display:inline-block;'
                            }else{
                                var downloaddisplay = 'display: none;'
                            }
                            data.forEach(function (v,i) {
                                var arr = v.attachFile.split('.');
                                var imgurl = iconImgType[arr[arr.length-1].toLowerCase()] || '/img/workflow/work/zip.png';
                                var attachName = v.attachName;
                                var fileExtension=attachName.substring(attachName.lastIndexOf(".")+1,attachName.length);//截取附件文件后缀
                                var attName = encodeURI(attachName).replace(/\+/g, "%2b").replace(/\@/g,"%40").replace(/#/g,"%23").replace(/\&/g,"%26").replace(/\//g,"%2F").replace(/\?/g,"%3F").replace(/\￥/g,"%ef%bf%a5").replace(/$/g,"%24").replace(/\！/g,"%ef%bc%81").replace(/\（/g,"%ef%bc%88").replace(/\）/g,"%ef%bc%89").replace(/\…/g,"%e2%80%a6%e2%80%a6");
                                var fileExtensionName=attName.substring(0,attName.lastIndexOf("."));
                                var attachmentUrl = v.attUrl;
                                attachmentUrl = attachmentUrl.substring(0,attachmentUrl.lastIndexOf("ATTACHMENT_NAME="))+"ATTACHMENT_NAME="+fileExtensionName+"."+fileExtension; //处理附件名字

                                var str2 = '';
                                var style = 'margin-left: 0px;';
                                if(fileExtension == 'doc' || fileExtension == 'DOC'|| fileExtension == 'docx' || fileExtension == 'DOCX'|| fileExtension == 'xls' || fileExtension == 'XLS'|| fileExtension == 'xlsx' || fileExtension == 'XLSX'|| fileExtension == 'ppt' || fileExtension == 'PPT'|| fileExtension == 'pptx'|| fileExtension == 'PPTX'){
                                    str2 = '<h2 attUrl="'+attachmentUrl+'" class="editBtn item_wordH2" style="'+ editdisplay +'"><fmt:message code="global.lang.edit" /></h2> ';
                                }
                                str += ' <li><div class="item_logo"><img src="'+imgurl+'"></div>' +
                                    '<div class="item_word" style="margin-top: 8px;letter-spacing: 1px;"><h1 class="item_wordH1" style="font-size: 11pt;" title="'+v.attachName+'">'+v.attachName+'</h1><h2></h2></div>' +
                                    '<div class="item_word" style="margin-top: 2px;font-size: 9pt;">' +function(){
                                        if(v.attachName.split('.')[1] != 'exe' && v.attachName.split('.')[1] != 'rar' && v.attachName.split('.')[1] != 'zip'){
                                            style = 'margin-left: 10px;';
                                            if(fileExtension == 'pdf' || fileExtension == 'PDF'|| fileExtension == 'png' || fileExtension == 'PNG' || fileExtension == 'jpg' || fileExtension == 'JPG'|| fileExtension == 'txt'|| fileExtension == 'TXT') { //判断是否需要查阅
                                                return '<h1 class="previewBtn item_wordH2" style="margin-left: 0;" attUrl="'+encodeURI(attachmentUrl)+'">查阅</h1>';
                                            }else{
                                                return '<h1 class="previewBtn item_wordH2" style="margin-left: 0;" attUrl="'+attachmentUrl+'">查阅</h1>';
                                            }
                                        }else{
                                            return '';
                                        }
                                    }()+ '<h1 class="downloadBtn item_wordH2" attUrl="'+encodeURI(attachmentUrl)+'" style="'+ style + downloaddisplay +'"><fmt:message code="file.th.download" /></h1>' +
                                    str2+
                                    '<h1 class="deletefileBtn item_wordH2" attUrl="'+encodeURI(attachmentUrl)+'" style="'+ deletedisplay +'"><fmt:message code="global.lang.delete" /></h1>'+
                                    '</div></li>';

                                fileStr += '<tr><td  align="left">' + v.attachName + ' ' +
                                    function () {
                                        if (fileExtension == 'pdf' || fileExtension == 'PDF' || fileExtension == 'png' || fileExtension == 'PNG' || fileExtension == 'jpg' || fileExtension == 'JPG' || fileExtension == 'txt' || fileExtension == 'TXT') { //判断是否需要查阅
                                            return '<a style="color: #1687cb;" class="fileDownload yulan"  href="javascript:void(0);" data-url="' + encodeURI(attachmentUrl) + '" style="margin-left: 10px">查阅</a>'
                                        } else {
                                            return '<a style="color: #1687cb;" class="fileDownload chayue"  href="javascript:void(0);" data-url="' + attachmentUrl + '" style="margin-left: 10px">查阅</a>'
                                        }
                                    }() + ' ' +
                                    function () {
                                        return '<a style="color: #1687cb;" class="download" url="/download?' + encodeURI(attachmentUrl) + '" href="javascript:void(0);" onclick="clickDownload($(this));">下载</a>'
                                    }() +
                                    '</td><td align="left">' + v.fileSize + '</td></tr>'

                            });
                            if($('#img_none')!=null||$('#img_none')!=undefined){
                                $('#img_none').hide();
                            }
                            layer.closeAll();
                            $.layerMsg({content:'上传成功！',icon:1},function(){
                            });
                            $('#oneUploadFile').show();
                            $('#oneUploadFile').append(str);
                            $('#flowFiles').show();
                            $('#flowFilesTBody').append(fileStr);
                        }else {
                            layer.closeAll();
                            $.layerMsg({content:'上传失败！',icon:2},function(){
                            });
                        }
                    }
                }
            });
        });
        //第一个
        $('.fujian').on('click',function(){
            $('.fujianhe').hide();
            if($(this).hasClass('check')){
                $('.position').click();
            }else{
                $('.fujian').find('a').css('color','#fff');
                $('.huiqian').find('a').css('color','#4889f0');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').show();
                $('#tab_ctwo').hide();
                $('.tab_one').show();
            }
        });
        //第二个
        $('.huiqian').on('click',function(){
            $('.huiqianhe').hide();
            if($(this).hasClass('check')){
                $('.position').click();
            }else {
                $('.fujian').find('a').css('color', '#4889f0');
                $(this).find('a').css('color', '#fff');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').show();
                $('#tab_ctwo').hide();
                $('.tab_one').show();
            }
        });
        //第三个
        $('.liucheng').on('click',function(){
            if($(this).hasClass('check')){
                $('.position').click();
            }else {
                var presetIn = globalData.flowProcesses.presetYN == 0 ? 0 : 1
                $('.cont_cthr').find('iframe').prop('src','/flowSetting/processDesignToolsT?type=2&flowId='+flowId+'&presetIn='+presetIn+'&runId='+runId);
                $('.huiqian').find('a').css('color', '#4889f0');
                $('.fujian').find('a').css('color', '#4889f0');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').show();
                $('.cont_cthr').siblings().hide();
                $('.tab_one').hide();
                $('#tab_ctwo').show();
                $('.cont_cthr').show();
                $('#tab_c').scrollTop(99999999999999);
            }
        });
        //第四个
        $('.guanlian').on('click',function(){
            if($(this).hasClass('check')){
                $('.position').click();
            }else {
                $('.huiqian').find('a').css('color', '#4889f0');
                $('.fujian').find('a').css('color', '#4889f0');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').show();
                $('.tab_one').hide();
                $('.cont_cthr').hide();
                $('.cont_cfour').hide();
                $('#tab_ctwo').show();
                $('.cont_cfour').show()
            }
        });
        $('.position').on('click',function () {
            $('#tab_c').hide();
            $('.check a').css('color','#4889f0');
            $('.check').removeClass('check');
        });
        //点击左下角的附件
        $('#attach_name').on('click',function(){
            $('.fujian').click();
        });
        $('#flowImg').click(function(){
            eventas=$('.num');
            window.open('../../flowSetting/processDesignToolTwo?flowId='+flowId+'&rilwId='+runId+'&type=banli');
        });
        $('#finish').click(function(){
            var loadingIndex = layer.load();
            //判断会签意见控件是否必填
            var form_item=$('.cont_form .form_item');
            for(var i=0; i<form_item.length;i++){
                var obj = form_item.eq(i);
                var datatype = obj.attr("data-type");
                var ismust = obj.attr('ismust');
                var isMustValue
                var isCheck = true;
                if(datatype == 'sign'){
                    isMustValue = '';
                    // 获取输入框的值
                    var valueSign = obj.val().trim();
                    // 有值跳过
                    if(valueSign){
                        isMustValue = valueSign;
                    }else{ // 无值，需要判断当前用户当前步骤是否填写过意见
                        var pre = obj.prev();
                        var $eiderarea = pre.find('.eiderarea');
                        var flowRunPrcs = workForm.option.flowRunPrcs;
                        $eiderarea.each(function(index, ele){
                            if ($(this).attr('user_id') == flowRunPrcs.userId && $(this).attr('prcs_id') == flowRunPrcs.flowPrcs) {
                                var signHtml = $(ele).prop("outerHTML");
                                var contentArr = signHtml.split(/>/);
                                var content = contentArr[1].split(/</)[0];
                                // var content = signHtml.match(/>(\S*?)<br>/)[1];
                                if (content.indexOf('{{content}}') == -1 && content.trim() != '') {
                                    isMustValue += content
                                }
                            }
                        });
                    }
                }
                if(isCheck && ismust == 'true' && isMustValue == ""){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                    if(gobackIndex != 1){                      //适用于设置了当前流程必填字段和当前流程转出条件的流程，点击回退按钮兼容效果
                        // flag = true;
                        layer.close(loadingIndex);
                        layer.msg('<fmt:message code="main.th.PleaseFill" />'+obj.attr('title'), {icon: 1});
                        return false;
                    }
                }
            }

            var flowfun = globalData.flowRun;
            var form_item=$('.special_form_item');
            var sign=$('.sign');
            var feedbackflag = false;
            if(globalData.feedback == '2'){  //如果值为2，判断强制会签
                var flowstep = globalData.flowPrcs;
                var userId = $.cookie('userId');
                if(globalData.data !=""&&globalData.data != undefined){
                    globalData.data.forEach(function(v,i){
                        if(v.userId == userId&&$.GetRequest().prcsId == v.flowPrcs){
                            feedbackflag = true;
                        }
                    })
                    if(!feedbackflag){
                        layer.close(loadingIndex);
                        $.layerMsg({content:'请提交会签意见',icon:6});
                        return false;
                    }
                }else{
                    layer.close(loadingIndex);
                    $.layerMsg({content:'请提交会签意见',icon:6});
                    return false;
                }

            }
            //处理会签控件
            if(sign.length != 0){
                var signdata = [];
                for(var i=0;i<sign.length;i++){
                    if(!sign.eq(i).attr('disabled')){
                        var pre = sign.eq(i).prev();
                        var baseData = {};
                        var realValue = sign.eq(i).val().trim();
                        var value = '';
                        if (realValue) {
                            var $eiderarea = pre.find('.eiderarea').eq(pre.find('.eiderarea').length-1);
                            if (!$eiderarea.attr('time_stamp')) {
                                var timeStamp = new Date().getTime();
                                $eiderarea.attr('time_stamp', timeStamp);
                            }
                            value = Mustache.render($eiderarea.prop("outerHTML"),{content:''});
                        }
                        baseData["key"] = sign.eq(i).attr('name');
                        baseData["value"]=value;
                        signdata.push(baseData);
                    }
                }
                if(signdata.length != 0){
                    $.ajax({
                        type: "post",
                        url: "/workflow/work/signControl",
                        dataType: 'JSON',
                        data: {
                            runId:flowfun.runId,
                            flowId:flowId,
                            signdata:JSON.stringify(signdata)
                        },
                        async:false,
                        success: function(res){}
                    });
                }
            }
            /********传阅会签控件开始**********/
            if(form_item.length != 0){
                for(var i=0;i<form_item.length;i++){
                    var obj = form_item.eq(i);
                    var ismust = obj.attr('ismust');
                    if(ismust == 'true'&&$('.countersignature_itemhide').length == 0){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                        layer.msg('请签名!', {icon: 1});
                        return false;
                    }else{
                        saveCSNtr_item(obj,function(){
                            if(form_item.length-1 == i){
                                var finishdata={
                                    runId:flowfun.runId,
                                    prcsId : flowStep,
                                    flowPrcs : prcsId,
                                    flowId:flowId,
                                    tableName:tableName,
                                    tabId:tabId
                                };
                                $.ajax({
                                    type: "post",
                                    url: "/workflow/work/saveHandle",
                                    dataType: 'JSON',
                                    data: finishdata,
                                    success: function(res){
                                        layer.close(loadingIndex);
                                        if(res.flag){
                                            $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                                                window.close();
                                                if (parent.opener.runWorkListPage) {
                                                    parent.opener.runWorkListPage();
                                                }

                                                if (parent.opener.openRold) {
                                                    parent.opener.openRold();
                                                }
                                            });
                                        }else{
                                            if(res.msg == '该用户是最后一个无主办人'){
                                                alert(res.msg+'!');
                                                location.reload();
                                            }
                                        }
                                    }
                                });
                            }
                        });
                    }

                }
            }else{
                var finishdata={
                    runId:flowfun.runId,
                    prcsId : flowStep,
                    flowPrcs : prcsId,
                    flowId:flowId,
                    tableName:tableName,
                    tabId:tabId
                };
                $.ajax({
                    type: "post",
                    url: "/workflow/work/saveHandle",
                    dataType: 'JSON',
                    data: finishdata,
                    success: function(res){
                        layer.close(loadingIndex);
                        if(res.flag){
                            $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                                window.close();

                                if (parent.opener.runWorkListPage) {
                                    parent.opener.runWorkListPage();
                                }

                                if (parent.opener.openRold) {
                                    parent.opener.openRold();
                                }
                            });
                        }else{
                            if(res.msg == '该用户是最后一个无主办人'){
                                alert(res.msg+'!');
                                location.reload();
                            }
                        }
                    }
                });
            }
            /********传阅会签控件结束**********/

            //弹出层  增加经办人办理完毕  时候取消提示   但是交办不影响，如果影响其他的你就还原

            //加签人点办理完毕时，会签人没有办理完毕要弹窗提醒
           /* $.ajax({
                type: 'post',
                url: '/workflow/work/queryopaddUserOver',
                data:{
                    runId:runId,
                    // opaddUser:userId
                },
                dataType: 'json',
                success:function(res) {
                    if(res.object!=undefined){
                        layer.confirm(res.object, {
                            icon: 3,
                            area: ['400px', '200px'],
                            title:'提示',
                            btn: ['确定', '强制办理完毕'],
                            cancel:function(index, layero){
                                layer.close(index);
                                layer.close(loadingIndex);
                            }
                            ,yes: function(index, layero){
                                layer.close(index);
                                layer.close(loadingIndex);
                            }
                            ,btn2: function(index, layero){
                                var flowfun = globalData.flowRun;
                                var form_item=$('.special_form_item');
                                var sign=$('.sign');
                                if(globalData.feedback == '2'){  //如果值为2，判断强制会签
                                    var flowstep = globalData.flowPrcs
                                    var arr=[];
                                    var userId = $.cookie('userId');
                                    if(globalData.data !=""&&globalData.data != undefined){
                                        globalData.data.forEach(function(v,i){
                                            arr.push(v.userId)
                                        })
                                        if(arr.indexOf(userId)<0){
                                            layer.close(loadingIndex);
                                            $.layerMsg({content:'请提交会签意见',icon:6});
                                            return false;
                                        }
                                    }else{
                                        layer.close(loadingIndex);
                                        $.layerMsg({content:'请提交会签意见',icon:6});
                                        return false;
                                    }

                                }
                                //处理会签控件
                                if(sign.length != 0){
                                    var signdata = [];
                                    for(var i=0;i<sign.length;i++){
                                        if(!sign.eq(i).attr('disabled')){
                                            var pre = sign.eq(i).prev();
                                            var baseData = {};
                                            var realValue = sign.eq(i).val().trim();
                                            var value = '';
                                            if (realValue) {
                                                var $eiderarea = pre.find('.eiderarea').eq(pre.find('.eiderarea').length-1);
                                                if (!$eiderarea.attr('time_stamp')) {
                                                    var timeStamp = new Date().getTime();
                                                    $eiderarea.attr('time_stamp', timeStamp);
                                                }
                                                value = Mustache.render($eiderarea.prop("outerHTML"),{content:''});
                                            }
                                            baseData["key"] = sign.eq(i).attr('name');
                                            baseData["value"]=value;
                                            signdata.push(baseData);
                                        }
                                    }
                                    if(signdata.length != 0){
                                        $.ajax({
                                            type: "post",
                                            url: "/workflow/work/signControl",
                                            dataType: 'JSON',
                                            data: {
                                                runId:flowfun.runId,
                                                flowId:flowId,
                                                signdata:JSON.stringify(signdata)
                                            },
                                            async:false,
                                            success: function(res){}
                                        });
                                    }
                                }
                                /!********传阅会签控件开始**********!/
                                if(form_item.length != 0){
                                    for(var i=0;i<form_item.length;i++){
                                        var obj = form_item.eq(i);
                                        var ismust = obj.attr('ismust');
                                        if(ismust == 'true'&&$('.countersignature_itemhide').length == 0){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                                            layer.close(loadingIndex);
                                            layer.msg('请签名!', {icon: 1});
                                            return false;
                                        }else{
                                            saveCSNtr_item(obj,function(){
                                                if(form_item.length-1 == i){
                                                    var finishdata={
                                                        runId:flowfun.runId,
                                                        prcsId : flowStep,
                                                        flowPrcs : prcsId,
                                                        flowId:flowId,
                                                        tableName:tableName,
                                                        tabId:tabId
                                                    };
                                                    $.ajax({
                                                        type: "post",
                                                        url: "/workflow/work/saveHandle",
                                                        dataType: 'JSON',
                                                        data: finishdata,
                                                        success: function(res){
                                                            layer.close(loadingIndex);
                                                            if(res.flag){
                                                                $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                                                                    window.close();
                                                                    if (parent.opener.runWorkListPage) {
                                                                        parent.opener.runWorkListPage();
                                                                    }
                                                                    if (parent.opener.openRold) {
                                                                        parent.opener.openRold();
                                                                    }
                                                                });
                                                            }else{
                                                                if(res.msg == '该用户是最后一个无主办人'){
                                                                    layer.close(loadingIndex);
                                                                    alert(res.msg+'!');
                                                                    location.reload();
                                                                }
                                                            }
                                                        }
                                                    });
                                                }
                                            });
                                        }

                                    }
                                }else{
                                    var finishdata={
                                        runId:flowfun.runId,
                                        prcsId : flowStep,
                                        flowPrcs : prcsId,
                                        flowId:flowId,
                                        tableName:tableName,
                                        tabId:tabId
                                    };
                                    $.ajax({
                                        type: "post",
                                        url: "/workflow/work/saveHandle",
                                        dataType: 'JSON',
                                        data: finishdata,
                                        success: function(res){
                                            layer.close(loadingIndex);
                                            if(res.flag){
                                                $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                                                    window.close();
                                                    if (parent.opener.runWorkListPage) {
                                                        parent.opener.runWorkListPage();
                                                    }
                                                    if (parent.opener.openRold) {
                                                        parent.opener.openRold();
                                                    }
                                                });
                                            }else{
                                                if(res.msg == '该用户是最后一个无主办人'){
                                                    layer.close(loadingIndex);
                                                    alert(res.msg+'!');
                                                    location.reload();
                                                }
                                            }
                                        }
                                    });
                                }
                                /!********传阅会签控件结束**********!/
                            }
                        }, function(index){
                            layer.close(index);
                            layer.close(loadingIndex);
                        });
                    }else{

                    }
                }
            })*/
        });
        $('#saveform').click(function(){
            saveFlowData(function(data){
                if(data.flag){
                    $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){

                    });
                }else{
                    $.layerMsg({content:'<fmt:message code="meet.th.SaveFailed" />！',icon:2},function(){

                    });
                }

            },'noCheck');
        });
        $('#saveform1').click(function(){
            var flowfun = globalData.flowRun;
            var form_item=$('.special_form_item');
            var sign=$('.sign');
            var feedbackflag = false;
            if(globalData.feedback == '2'){  //如果值为2，判断强制会签
                var flowstep = globalData.flowPrcs;
                var userId = $.cookie('userId');
                if(globalData.data !=""&&globalData.data != undefined){
                    globalData.data.forEach(function(v,i){
                        if(v.userId == userId&&$.GetRequest().prcsId == v.flowPrcs){
                            feedbackflag = true;
                        }
                    })
                    if(!feedbackflag){
                        layer.close(loadingIndex);
                        $.layerMsg({content:'请提交会签意见',icon:6});
                        return false;
                    }
                }else{
                    layer.close(loadingIndex);
                    $.layerMsg({content:'请提交会签意见',icon:6});
                    return false;
                }

            }
            //处理会签控件
            if(sign.length != 0){
                var signdata = [];
                for(var i=0;i<sign.length;i++){
                    if(!sign.eq(i).attr('disabled')){
                        var pre = sign.eq(i).prev();
                        var realValue = sign.eq(i).val().trim();
                        var baseData = {};
                        var value = '';
                        if (realValue) {
                            var $eiderarea = pre.find('.eiderarea').eq(pre.find('.eiderarea').length-1);
                            if (!$eiderarea.attr('time_stamp')) {
                                var timeStamp = new Date().getTime();
                                $eiderarea.attr('time_stamp', timeStamp);
                            }

                            value = Mustache.render($eiderarea.prop("outerHTML"),{content:''});
                        }
                        baseData["key"] = sign.eq(i).attr('name');
                        baseData["value"]=value;
                        signdata.push(baseData);
                    }
                }
                if(signdata.length != 0){
                    $.ajax({
                        type: "post",
                        url: "/workflow/work/signControl",
                        dataType: 'JSON',
                        data: {
                            runId:flowfun.runId,
                            flowId:flowId,
                            signdata:JSON.stringify(signdata)
                        },
                        async:false,
                        success: function(res){}
                    });
                }
            }
            /********传阅会签控件开始**********/
            if(form_item.length != 0){
                for(var i=0;i<form_item.length;i++){
                    var obj = form_item.eq(i);
                    var ismust = obj.attr('ismust');
                    if(ismust == 'true'&&$('.countersignature_itemhide').length == 0){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                        layer.msg('请签名!', {icon: 1});
                        return false;
                    }else{
                        saveCSNtr_item(obj,function(){
                            $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                                location.reload();
                            });
                        });
                    }

                }
            }else{
                $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                    location.reload();
                });
            }
        });
        $('#saveformback1').click(function(){
            $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                window.close();
            });
        });
        $('#cancleBtn1').click(function(){
            $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                window.close();
            });
        });
        $('#saveformback').click(function(){
            saveFlowData(function(){

                //window.close();
				window.history.go(-1);
                if(parent.opener.openRold!=undefined){
                    parent.opener.openRold()
                }
                if(parent.opener.runWorkListPage!=undefined){
                    parent.opener.runWorkListPage();
                }
            },'noCheck');
        });
        $('.zhuanjiao').on('click',function(){
            if(!$('#officialDocument').is(':hidden')){
                $('.tabAB .fl').eq(0).click();
            }
            //判断工作交办人是否办理完毕
            var typeOver=assignIsOver()
            if(typeOver && typeOver.code==0){
                var assign=''
                for(var i=0;i<typeOver.obj.length;i++){
                    assign+=typeOver.obj[i].handleUserName+','
                }
                layer.confirm(assign.substring(0,assign.length-1)+'还没办理完毕！', {
                    icon: 3,
                    area: ['400px', '200px'],
                    title:'提示',
                    btn: ['确定', '强制转交']
                    ,yes: function(index, layero){
                        layer.close(index);
                    }
                    ,btn2: function(index, layero){
                        zhuanjiaoNext()
                    }
                })
                return false
            }
            compareFunc();
            zhuanjiaoNext()
        });
        // 滑到顶部
        $('#scrollTop').on('click', function(){
            $('html,body').animate({scrollTop: 0},500);
        });
        // 滑到底部
        $('#scrollBottom').on('click', function(){
            var $sign = $('.sign');
            var top = 0;
            if ($sign.length > 0) {
                var index = -1;
                for (var i = $sign.length; i > 0; i--) {
                    if (!$sign.eq(i-1).is(':hidden')) {
                        index = i - 1;
                        break;
                    }
                }
                if (index != -1) {
                    top = $sign.eq(index).offset().top - 300;
                    $sign.eq(index).focus();
                } else {
                    top = $(document).height()-$(window).height();
                }
            } else {
                top = $(document).height()-$(window).height();
            }
            $('html,body').animate({scrollTop: top},500);
        });
        //转交下一步
        function zhuanjiaoNext(){
            if(globalData.checkTurnPriv ==0){
                layer.msg('经办人未办理完毕，无法转交');
                return false;
            }
            //预算
            if(tableName == 'budget'&&$('.DATA_218').length != 0&&$('.DATA_204').length != 0){
                if($('.DATA_204').attr('disabled') != 'disabled'){
                    var num1 = $('.DATA_218').val(),num2 = $('.DATA_204').val();
                    var del  = parseInt(num1) - parseInt(num2);
                    var id = $('#DATA_213').val();
                    if(del < 0){
                        layer.msg('可用金额不得小于实际支出金额',{time:5000,icon:2});
                    }else{
                        $.ajax({
                            url:'/budget/upBudgetItemById1',
                            type:'get',
                            data:{
                                budgetId:id,
                                remainingAmount:del
                            },
                            async:false,
                            dataType:'json',
                            success:function(res){
                            }
                        })
                    }
                }
            }
            if(globalData.feedback == '2'){  //如果值为2，判断强制会签
                var feedbackflag = false;
                var NewuserId = $.cookie('userId');
                if(globalData.data !=""&&globalData.data != undefined){
                    globalData.data.forEach(function(v,i){
                        if(v.userId == NewuserId&&$.GetRequest().prcsId == v.flowPrcs){
                            feedbackflag = true;
                        }
                    })
                    if(!feedbackflag){
                        $.layerMsg({content:'请提交会签意见',icon:6});
                        return false;
                    }
                }else{
                    $.layerMsg({content:'请提交会签意见',icon:6});
                    return false;
                }
            }
            if('1' == globalData.gatherNodePriv){
                layer.alert("<fmt:message code="work.th.hebing" />！", {
                    icon: 0,
                    title:'NO.'+globalData.flowRun.runId+'&nbsp;&nbsp;'+globalData.flowRun.runName,
                    skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则，去这里查阅
                })
                return false;
            }
            //保存表格数据的接口
            saveFlowData(function(res){
                var indexss = layer.load(1);
                if(!res.flag){
                    alert('<fmt:message code="meet.th.SaveFailed" />！')
                    layer.close(indexss);
                    return false;
                }
                var formLength=globalData.option.formLength;
                var obj=globalData.flowRun;
                var listFp = globalData.listFp
                if(globalData.autoEdit == 0){
                    var thisrunName= $('.num').attr('thisrunName')||'';
                }else if(globalData.autoEdit == 1){
                    var thisrunName= $('.runname').val();
                }
                var titleName='<img src="/img/spicon.png" style="position: absolute;top: 8px;left: 30px;">'+'<span style="display: inline-block;letter-spacing: 0.5px;margin-left: 43px;">'+thisrunName+'</span>';
                var prcsTo;
                var prcsToBycode;
                var prcsName='';
                var turnObj = {};
                var nextFlowid = ''
                var syncDeal='';
                var workflowpricToArray = '';
                if(globalData.flowProcesses.syncDeal == 0){
                    syncDeal = '';
                    <%--<fmt:message code="workflow.th.Prohibitconcurrency" />--%>
                }else if(globalData.flowProcesses.syncDeal == 1){
                    syncDeal = '<fmt:message code="work.th.step" />'+'<fmt:message code="workflow.th.AllowConcurrent" />';
                }else if(globalData.flowProcesses.syncDeal == 2){
                    syncDeal = '<fmt:message code="work.th.step" />'+'<fmt:message code="workflow.th.ForcedConcurrent" />';
                }
                for(var i=0;i<listFp.length;i++){
                    var obj2=listFp[i];
                    if(prcsId == obj2.prcsId){
                        turnObj = obj2;
                        if(obj2.prcsTo!=""){
                            prcsToBycode = obj2.prcsTo;
                            prcsTo= subPric(obj2.prcsTo,",");
                            break;
                        }
                        break;
                    }
                }
                if(globalData.flowProcesses.prcsType == '4'){   //循环节点
                    prcsTo.push(prcsId)
                }

                if(prcsTo){
                    var specialNmae = '';
                    var indexCurrent = 0;
                    var index = 0;
                    var index1 = 0;
                    for (var j=0;j<prcsTo.length;j++){
                        index1++;
                        if(j == 1){
                            nextFlowid = prcsTo[0];
                        }
                        if(prcsTo[j]=='0'){
                            /*************父子流程判断start*********************************/
                            if(globalData.flowRun.parentRun != undefined&&globalData.flowRun.parentRun != ''&&globalData.flowRun.parentRun != 0){
                                var obj2_new;
                                specialNmae = '';
                                $.ajax({
                                    type:'post',
                                    url:'/workflow/work/returnPrentFlowUser?runId='+runId,
                                    async:false,
                                    dataType:'json',
                                    success:function(data){
                                        if(data.flag&&data.object != undefined){
                                            obj2_new = data.object;
                                        }
                                    }
                                })
                                if(obj2_new){
                                    var user = null;
                                    if (obj2_new.childRunData && obj2_new.childRunData.autoTypelist.length > 0) {
                                        user = obj2_new.childRunData.autoTypelist[0]
                                    }
                                    var autoUserOpReturnName = obj2_new.autoUserOpReturnName ? obj2_new.autoUserOpReturnName : user ? user.userName : '';
                                    var autoUserOpReturn = obj2_new.autoUserOpReturn ? obj2_new.autoUserOpReturn : user ? user.userId : '';
                                    var autoUserReturnName = obj2_new.autoUserReturnName ? obj2_new.autoUserReturnName : user ? user.userName : '';
                                    var autoUserReturn = obj2_new.autoUserReturn ? obj2_new.autoUserReturn : user ? user.userId : '';
                                    specialNmae = 'fatherSonFlow';
                                    workflowpricToArray +=  '<li class="workflow-node-result clearfix fatherSonFlowID" id="userSelectBtn_'+obj2_new.prcsId+'">'+
                                        '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2_new.prcsName+'</span><input type="button" class="userSelectBtn '+ specialNmae +'" name="userSelectBtn" pid="'+obj2_new.prcsId+'"  value="" topDefault="'+ obj2_new.topDefault +'" flowid="'+ obj2_new.flowId +'"></div> </div>'+
                                        '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;"><input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                        '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                        '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span><fmt:message code="sup.th.Sponsor" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                        '<div class="attach_div small TOP_FLAG_SHOW2_menu"  pid="'+obj2_new.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                        '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                        '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                        '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2_new.prcsId+'" user_id="'+ autoUserOpReturn +'" style="width: 120px;border-radius: 0px;" value="'+ autoUserOpReturnName+'"></div>'+
                                        '<div id="prcs_op_block_div2" class="clearfix">'+
                                        '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                        '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea class="user-tags" user_id="'+ autoUserReturn +'"  readonly="readonly" topDefault="'+ obj2_new.topDefault +'" id="jingban_'+obj2_new.prcsId+'" style="width: 240px;">'+ autoUserReturnName +'</textarea></div></div></li>';

                                }
                                /*************父子流程判断end*********************************/
                            }else{
                                var specialNmae = '';
                            }
                            if(indexCurrent == 0){
                                prcsName+='<div class="prcsName prcsName_chang '+ specialNmae +'" style="" prcsId=0><h1><fmt:message code="main.th.EndProcess" /></h1></div>';
                            }else{
                                prcsName+='<div class="prcsName '+ specialNmae +'" style="" prcsId=0><h1><fmt:message code="main.th.EndProcess" /></h1></div>';
                            }
                            index = 1;
                            indexCurrent++;
                        }
                        for(var i=0;i<listFp.length;i++){
                            var obj2=listFp[i];

                            if(obj2.prcsId == prcsTo[j]){
                                checkPrcIn(obj2.prcsIn,obj2.prcsInSet,JSON.parse(res.opt.formdata),JSON.parse(res.opt.fromDataReject),function(res){
                                    var className = '';
                                    var attrName = '';
                                    if(obj2.childFlow&&obj2.childFlow != 0){
                                        var className = 'SonFlowID';
                                        var attrName = 'childFlow="'+ obj2.childFlow +'"';
                                    }
                                    if(res.flag){
                                        if(indexCurrent == 0){
                                            indexCurrent++;
                                            prcsName+='<div title="'+obj2.prcsName+'" class="prcsName prcsName_chang" style="" prcsId='+obj2.prcsId+'><h1 >'+obj2.prcsName+'</h1></div>';
                                            if(obj2.topDefault == 0){
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix '+ className +'" id="userSelectBtn_'+obj2.prcsId+'" '+ attrName +'>'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2.prcsName+'</span><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="" topDefault="'+ obj2.topDefault +'"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;"><input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span><fmt:message code="sup.th.Sponsor" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div class="attach_div small TOP_FLAG_SHOW2_menu"  pid="'+obj2.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                                    '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2.prcsId+'" user_id="" style="width: 120px;border-radius: 0px;"></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea class="user-tags" user_id=""  readonly="readonly" topDefault="'+ obj2.topDefault +'" id="jingban_'+obj2.prcsId+'" style="width: 240px;"></textarea></div></div></li>';

                                            }else if(obj2.topDefault == 1){
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix  '+ className +'" id="userSelectBtn_'+obj2.prcsId+'" '+ attrName +'>'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2.prcsName+'</span><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="" topDefault="'+ obj2.topDefault +'"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;"><input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span style="color: blue;"><fmt:message code="main.th.FirstReceiverHosting" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div class="attach_div small TOP_FLAG_SHOW2_menu" pid="'+obj2.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                                    '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2.prcsId+'" user_id="" style="width: 120px;border-radius: 0px;display: none;"></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea class="user-tags" user_id=""  readonly="readonly"  topDefault="'+ obj2.topDefault +'" id="jingban_'+obj2.prcsId+'" style="width: 240px;"></textarea></div></div></li>';

                                            }else{
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix  '+ className +'" id="userSelectBtn_'+obj2.prcsId+'" '+ attrName +'>'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2.prcsName+'</span><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="" topDefault="'+ obj2.topDefault +'"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;"><input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span style="color: blue;"><fmt:message code="workflow.th.NoSponsorWillSign" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div class="attach_div small TOP_FLAG_SHOW2_menu"  pid="'+obj2.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                                    '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2.prcsId+'" user_id="" style="width: 120px;border-radius: 0px;display: none;"></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea class="user-tags" user_id=""  readonly="readonly"  topDefault="'+ obj2.topDefault +'" id="jingban_'+obj2.prcsId+'" style="width: 240px;"></textarea></div></div></li>';

                                            }
                                        }else{
                                            if(globalData.flowProcesses.syncDeal != 2){
                                                prcsName+='<div title="'+obj2.prcsName+'" class="prcsName" style="" prcsId='+obj2.prcsId+'><h1>'+obj2.prcsName+'</h1></div>';

                                            }else{
                                                prcsName+='<div title="'+obj2.prcsName+'" class="prcsName prcsName_chang" style="" prcsId='+obj2.prcsId+'><h1>'+obj2.prcsName+'</h1></div>';

                                            }
                                            if(obj2.topDefault == 0){
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix hide  '+ className +'" id="userSelectBtn_'+obj2.prcsId+'" '+ attrName +'>'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2.prcsName+'</span><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="" topDefault="'+ obj2.topDefault +'"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;">'+
                                                    '<input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span><fmt:message code="sup.th.Sponsor" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div class="attach_div small TOP_FLAG_SHOW2_menu"  pid="'+obj2.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                                    '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2.prcsId+'" user_id="" style="width: 120px;border-radius: 0px;"></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea  readonly="readonly" class="user-tags" user_id=""  topDefault="'+ obj2.topDefault +'" id="jingban_'+obj2.prcsId+'" style="width: 240px;"></textarea></div></div></li>';

                                            }else if(obj2.topDefault == 1){
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix hide  '+ className +'" id="userSelectBtn_'+obj2.prcsId+'" '+ attrName +'>'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2.prcsName+'</span><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="" topDefault="'+ obj2.topDefault +'"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;">'+
                                                    '<input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span style="color: blue;"><fmt:message code="main.th.FirstReceiverHosting" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div class="attach_div small TOP_FLAG_SHOW2_menu"  pid="'+obj2.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                                    '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2.prcsId+'" user_id="" style="width: 120px;border-radius: 0px;display: none;"></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea  readonly="readonly" class="user-tags" user_id=""  topDefault="'+ obj2.topDefault +'" id="jingban_'+obj2.prcsId+'" style="width: 240px;"></textarea></div></div></li>';

                                            }else{
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix hide  '+ className +'" id="userSelectBtn_'+obj2.prcsId+'" '+ attrName +'>'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops" style="position: relative;"><span class="workflow-node-sp">'+obj2.prcsName+'</span><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="" topDefault="'+ obj2.topDefault +'"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix"  style="margin-bottom: 10px;">'+
                                                    '<input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><span style="color: blue;"><fmt:message code="workflow.th.NoSponsorWillSign" /></span>：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div class="attach_div small TOP_FLAG_SHOW2_menu"  pid="'+obj2.prcsId+'" style="display: none; top: 40px; left: 170px;position:absolute;background:#fff;">'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="sup.th.Sponsor" /></a>'+
                                                    '<a href="javascript:void(0);" style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="main.th.FirstReceiverHosting" /></a><a href="javascript:void(0); " style="display:block;text-align:center;padding:0px 5px;line-height:21px;"><fmt:message code="workflow.th.NoSponsorWillSign" /></a></div></div>'+
                                                    '<input type="text" class="user-tags"  readonly="readonly" id="remind_name_'+obj2.prcsId+'" user_id="" style="width: 120px;border-radius: 0px;display: none;"></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea  readonly="readonly" class="user-tags" user_id=""  topDefault="'+ obj2.topDefault +'" id="jingban_'+obj2.prcsId+'" style="width: 240px;"></textarea></div></div></li>';
                                            }
                                        }
                                    }else{
                                        prcsName+='<div class="prcsName" style="" prcsId='+obj2.prcsId+'><span class="tipmsg" style="display: none;" msg="'+obj2.conditionDesc.split('\n')[0]+'"><fmt:message code="main.th.NonConformity" /></span><h1>'+obj2.prcsName+'</h1></div>';

                                    }
                                });

                            }
                        }
                    }
                }
                //找到表格上的内容
                var form_item=$('.cont_form .form_item');
                var realData=[];
                var radioArr = {};
                var modifydata =[]
                var flag = false;
                var flowSelectAutoList;
                if(globalData.prcsType == 4){
                    prcsToBycode += prcsId + ',';
                }

                if(prcsToBycode==undefined){
                    alert('<fmt:message code="work.th.liucheng" />');
                    layer.close(indexss);
                    return;
                }
                var dataFind={
                    flowId:flowId,
                    runId:runId,
                    currentFlowPrcs:prcsId
                }
                $.ajax({
                    type:'get',
                    url:'/syspara/queryOrgScope',
                    dataType:'json',
                    success:function (reg) {
                        var item=reg.object;

                        if(item.paraValue == 1){
                            paraValue = 1;
                            $.ajax({
                                url:'/getUserOrg',
                                dataType:'json',
                                async: false,
                                type:'get',
                                success:function(res){
                                    if(res.flag&&res.obj.length>0){
                                        for(var i=0;i<res.obj.length;i++){
                                            deptNo += res.obj[i].deptNo +','
                                        }
                                    }
                                    dataFind.deptNo = deptNo;
                                }
                            })

                        }else{
                            deptNo = ''
                            dataFind.deptNo = deptNo;
                        }

                        $.ajax({
                            type: "get",
                            url: "/workflow/work/getBranch",
                            dataType: 'text',
                            async: false,
                            data: dataFind,
                            success: function(obj){
                                if(!obj||obj ==''){
                                    return false;
                                    layer.closeAll();
                                }
                                obj = eval('(' + obj + ')');
                                var data1 = '';
                                if(obj.flag){
                                    flowSelectAutoList = obj.obj
                                }
                                var prcsFlag = '<fmt:message code="lang.th.Process" />';
                                checkPrcOut(JSON.parse(res.opt.formdata),JSON.parse(res.opt.fromDataReject),function(res){

                                    if(res.flag){
                                        layer.close(indexss);
                                        // var thisrunname = $('.runname').val();
                                        //由于标题可编辑或不可编辑，针对thisrunname进行特殊处理
                                        if(globalData.autoEdit == 0){
                                            var thisrunname= $('.num').attr('thisrunName')||'';
                                        }else if(globalData.autoEdit == 1){
                                            var thisrunname= $('.runname').val();
                                        }
                                        if(specialNmae == 'fatherSonFlow'){
                                            var runnid = globalData.flowRun.parentRun;

                                            $.ajax({
                                                type: "get",
                                                url: "/flowRun/queryFlowRunById",
                                                dataType: 'json',
                                                async: false,
                                                data: {
                                                    runId:runnid
                                                },
                                                success: function(obj){
                                                    thisrunname = obj.object.runName;
                                                }
                                            });

                                        }else{
                                            var runnid = globalData.flowRun.runId;
                                        }
                                        if($('#level').val() == 0){
                                            var specialName = '';
                                        }else if($('#level').val() == 1){
                                            var specialName = '【紧急】';
                                        }else if($('#level').val() == 2){
                                            var specialName = '【特急】';
                                        }
                                        if(globalData.projectId=='dazu'){
                                            var tipMsg = thisrunname
                                        }else{
                                            var tipMsg = specialName+thisrunname+'，流水号：'+runnid;
                                        }


                                        if(index == 1&&index1 == 2){
                                            var content = '<div class="modal-body" style="">'+
                                                '<div style="border: 1px solid #d6d6d6;border-radius: 5px;margin-bottom: 25px;"><div class="work-prcs-title" id="op_user_show_info" style="margin-bottom: 20px;border: none;height: 22px;line-height: 22px;font-weight: normal;position: relative;"><img src="/img/gzlnum1.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="main.th.nextStep" />：<fmt:message code="main.th.currentStep" />'+flowStep+'<fmt:message code="workflow.th.step" /> ('+ globalData.flowTypeModel.flowName+') </span>'+
                                                '<font color="#af0707" style="margin-left: 10px;"><div self_type="self" style="display:inline;">'+globalData.userName+'&nbsp;&nbsp;('+prcsFlag+')&nbsp;&nbsp;'+syncDeal+'</div>'+
                                                '<div style="margin-top: -21px;margin-left: 274px;"></div></font></div><div class="work-prcs-block">'+
                                                '<div class="work-prcs-content clearfix" style=""><div class="workflow-procs-nodes-wrap"><ul id="workPrcsData"  class="workflow-procs-nodes"><li class="workflow-node" style="" id="next_prcs_2">'+
                                                prcsName+'<ol></ol> </li></ul></div><div class="workflow-procs-nodes-result-wrap">'+
                                                '<ul id="work-next-prcs-block" class="workflow-procs-nodes-result" style="top: 0px;">'+workflowpricToArray+
                                                '</ul></div>' +
                                                '<div title="暂不办结本步骤，可继续办理" style="display: none;" class="turnTypeName turnType"><h1 style="margin-left:33px;line-height:40px">暂不办结本步骤，可继续办理</h1></div>'+
                                                '</div></div></div>' +
                                                '<div class="work-msg-block hide" id="viewbox" style="margin-bottom: 25px;display:none;"><div class="work-msg-title"><img src="/img/gzlnum2.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="work.th.add" /></span></div><div class="work-msg-content" style="display: block;position: relative;padding: 15px 10px;"><div class="cytitle">传阅人：</div><div class="clearfix" style="margin-left: 233px;"><textarea name="viewUserName" id="viewUserName" dataid="" username="" readonly="" style="width:468px;height: 60px;"></textarea>&nbsp;<a class="orgAdd" id="viewUserNameSelect" tarobj = "viewUserName" style="color: #3691da;margin-left: 5px;">选择</a>&nbsp;<a class="orgClear"  tarobj = "viewUserName" id="viewUserNameClear" style="color: #3691da;margin-left: 15px;">清空</a></div></div></div>'+
                                                '<div class="work-msg-block"><div class="work-msg-title"><img src="/img/gzlnum3.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="main.th.Sendmessage" /></span></div>'+
                                                '<div class="work-msg-content" style="display: block;"><div class="clearfix">'+
                                                '<div data_type="next" class="work-msg-op-title"><div class="gjtitles"><fmt:message code="workflow.th.nextstep" />：</div><span class="addactiveClass sms-check sms-bg sms-bg-static active" style="margin-left: 70px;" data-id="1" title="<fmt:message code="notice.th.remindermessage" />"></span><span class="xuanzhong xuanzhongactive"><fmt:message code="sms.th.remind" /></span><span  class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                '<span data-id="2" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span><span class="xuanzhong xuanzhong1"><fmt:message code="adding.th.duanxin" /></span>'+
                                                '</div>'+
                                                '<div data_type="create" class="work-msg-op-title" style="width: 259px;"><div class="gjtitles"><fmt:message code="workflow.th.Initiator" />：</div><span data-id="3" class="addactiveClass sms-check sms-bg sms-bg-static active" style="margin-left: 60px;" title="<fmt:message code="notice.th.remindermessage" />"></span><span class="xuanzhong xuanzhongactive" style="left: 87px;"><fmt:message code="sms.th.remind" /></span>'+
                                                '<span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                '<span data-id="4" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span><span class="xuanzhong xuanzhong1" style="left: 183px;"><fmt:message code="adding.th.duanxin" /></span></div>'+
                                                '<div data_type="managers" class="work-msg-op-title" style="margin-right: 0;width:286px;"><div class="gjtitles" ><fmt:message code="doc.th.AllHandlers" />：</div><span data-id="5" class="addactiveClass sms-check sms-bg sms-bg-static" title="<fmt:message code="notice.th.remindermessage" />" style="margin-left: 90px;"></span><span class="xuanzhong" style="    left: 115px;"><fmt:message code="sms.th.remind" /></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                '<span data-id="6" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span> <span class="xuanzhong xuanzhong1" style="left: 220px;"><fmt:message code="adding.th.duanxin" /></span></div>' +

                                                '<div data_type="circulate" class="work-msg-op-title" style="margin-right: 0;width:286px;"><div class="gjtitles" >传阅人：</div><span data-id="8" class="addactiveClass sms-check sms-bg sms-bg-static active" title="<fmt:message code="notice.th.remindermessage" />" style="margin-left: 70px;"></span><span class="xuanzhong xuanzhongactive" style="    left: 96px;"><fmt:message code="sms.th.remind" /></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                '<span data-id="9" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span> <span class="xuanzhong xuanzhong1" style="left: 197px;"><fmt:message code="adding.th.duanxin" /></span></div> '+

                                                '</div>'+
                                                '<div class="clearfix" style="position: relative;margin: 10px 0;display: none;"><div class="cytitle" style="top: 15px;left: 0px;"><fmt:message code="main.th.RemindHandler" />：</div><div style="margin-left: 150px;"><input type="hidden" name="remind_others_id" id="remind_others_id" value="">'+
                                                '<textarea name="remind_others_name" id="remind_others_name" readonly="" style="width:550px;height: 40px;"></textarea>&nbsp;'+
                                                '<a class="orgAdd" id="others-add" style="color: #3691da;margin-left: 5px;"><fmt:message code="global.lang.select" /></a>&nbsp;<a class="orgClear" style="color: #3691da;margin-left: 5px;" id="others-clear" href="javascript:ClearUser("remind_others_id", "remind_others_name");"><fmt:message code="global.lang.empty" /></a></div>'+
                                                '</div><div class="work-msg-sms-block" style="position: relative;margin-bottom: 10px;height: auto;"><div class="cytitle" style="top: 15px;left: 0px;"><fmt:message code="main.th.ReminderContent" />：</div><div style="margin-left: 150px;"><textarea style="width: 550px;height: 50px;padding: 7px;" name="SMS_CONTENT" id="SMS_CONTENT">'+tipMsg+'</textarea></div>'+
                                                ' </div></div></div></div>'
                                        }else{

                                            if(prcsId !=1){
                                                var content = '<div class="modal-body" style="">'+
                                                    '<div style="border: 1px solid #d6d6d6;border-radius: 5px;margin-bottom: 25px;"><div class="work-prcs-title" id="op_user_show_info" style="margin-bottom: 20px;border: none;height: 22px;line-height: 22px;font-weight: normal;position: relative;"><img src="/img/gzlnum1.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="main.th.nextStep" />：<fmt:message code="main.th.currentStep" />'+flowStep+'<fmt:message code="workflow.th.step" /> ('+ globalData.flowTypeModel.flowName+') </span>'+
                                                    '<font color="#af0707" style="margin-left: 10px;"><div self_type="self" style="display:inline;">'+globalData.userName+'&nbsp;&nbsp;('+prcsFlag+')&nbsp;&nbsp;'+syncDeal+'</div>'+
                                                    '<div style="margin-top: -21px;margin-left: 274px;"></div></font></div><div class="work-prcs-block">'+
                                                    '<div class="work-prcs-content clearfix" style=""><div class="workflow-procs-nodes-wrap"><ul id="workPrcsData"  class="workflow-procs-nodes"><li class="workflow-node" style="" id="next_prcs_2">'+
                                                    prcsName+'<ol></ol> </li></ul></div><div class="workflow-procs-nodes-result-wrap">'+
                                                    '<ul id="work-next-prcs-block" class="workflow-procs-nodes-result" style="top: 0px;">'+workflowpricToArray+
                                                    '</ul></div>' +
                                                    '<div title="暂不办结本步骤，可继续办理" style="display: none;" class="turnTypeName turnType"><h1 style="margin-left:33px;line-height:40px">暂不办结本步骤，可继续办理</h1></div>'+
                                                    '</div></div></div>' +
                                                    '<div class="work-msg-block hide" id="viewbox" style="margin-bottom: 25px;display:none;"><div class="work-msg-title"><img src="/img/gzlnum2.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="work.th.add" /></span></div><div class="work-msg-content" style="display: block;position: relative;padding: 15px 10px;"><div class="cytitle">传阅人：</div><div class="clearfix" style="margin-left: 233px;"><textarea name="viewUserName" id="viewUserName" dataid="" username="" readonly="" style="width:468px;height: 60px;"></textarea>&nbsp;<a class="orgAdd" id="viewUserNameSelect" tarobj = "viewUserName" style="color: #3691da;margin-left: 5px;">选择</a>&nbsp;<a class="orgClear"  tarobj = "viewUserName" id="viewUserNameClear" style="color: #3691da;margin-left: 15px;">清空</a></div></div></div>'+
                                                    '<div class="work-msg-block"><div class="work-msg-title"><img src="/img/gzlnum3.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="main.th.Sendmessage" /></span></div>'+
                                                    '<div class="work-msg-content" style="display: block;"><div class="clearfix">'+
                                                    '<div data_type="next" class="work-msg-op-title"><div class="gjtitles"><fmt:message code="workflow.th.nextstep" />：</div><span class="addactiveClass sms-check sms-bg sms-bg-static active" style="margin-left: 70px;" data-id="1" title="<fmt:message code="notice.th.remindermessage" />"></span><span class="xuanzhong xuanzhongactive"><fmt:message code="sms.th.remind" /></span><span  class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="2" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span><span class="xuanzhong xuanzhong1"><fmt:message code="adding.th.duanxin" /></span>'+
                                                    '</div>'+
                                                    '<div data_type="create" class="work-msg-op-title" style="width: 259px;"><div class="gjtitles"><fmt:message code="workflow.th.Initiator" />：</div><span data-id="3" class="addactiveClass sms-check sms-bg sms-bg-static" style="margin-left: 60px;" title="<fmt:message code="notice.th.remindermessage" />"></span><span class="xuanzhong" style="left: 87px;"><fmt:message code="sms.th.remind" /></span>'+
                                                    '<span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="4" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span><span class="xuanzhong xuanzhong1" style="left: 183px;"><fmt:message code="adding.th.duanxin" /></span></div>'+
                                                    '<div data_type="managers" class="work-msg-op-title" style="margin-right: 0;width:286px;"><div class="gjtitles" ><fmt:message code="doc.th.AllHandlers" />：</div><span data-id="5" class="addactiveClass sms-check sms-bg sms-bg-static" title="<fmt:message code="notice.th.remindermessage" />" style="margin-left: 90px;"></span><span class="xuanzhong" style="    left: 115px;"><fmt:message code="sms.th.remind" /></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="6" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span> <span class="xuanzhong xuanzhong1" style="left: 220px;"><fmt:message code="adding.th.duanxin" /></span></div> '+

                                                    '<div data_type="circulate" class="work-msg-op-title" style="margin-right: 0;width:286px;"><div class="gjtitles" >传阅人：</div><span data-id="8" class="addactiveClass sms-check sms-bg sms-bg-static active" title="<fmt:message code="notice.th.remindermessage" />" style="margin-left: 70px;"></span><span class="xuanzhong xuanzhongactive" style="    left: 96px;"><fmt:message code="sms.th.remind" /></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="9" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span> <span class="xuanzhong xuanzhong1" style="left: 197px;"><fmt:message code="adding.th.duanxin" /></span></div> '+

                                                    '</div>'+
                                                    '<div class="clearfix" style="position: relative;margin: 10px 0;display: none;"><div class="cytitle" style="top: 15px;left: 0;"><fmt:message code="main.th.RemindHandler" />：</div><div style="margin-left: 150px;"><input type="hidden" name="remind_others_id" id="remind_others_id" value="">'+
                                                    '<textarea name="remind_others_name" id="remind_others_name" readonly="" style="width:550px;height: 40px;"></textarea>&nbsp;'+
                                                    '<a class="orgAdd" id="others-add" style="color: #3691da;margin-left: 5px;"><fmt:message code="global.lang.select" /></a>&nbsp;<a class="orgClear" style="color: #3691da;margin-left: 5px;" id="others-clear" href="javascript:ClearUser("remind_others_id", "remind_others_name");"><fmt:message code="global.lang.empty" /></a></div>'+
                                                    '</div><div class="work-msg-sms-block" style="position: relative;margin-bottom: 10px;height: auto;"><div class="cytitle" style="top: 15px;left: 0;"><fmt:message code="main.th.ReminderContent" />：</div><div style="margin-left: 150px;"><textarea style="width: 550px;height: 50px;padding: 7px;" name="SMS_CONTENT" id="SMS_CONTENT">'+tipMsg+'</textarea></div>'+
                                                    ' </div></div></div></div>';
                                            }else{
//                                            console.log(workflowpricToArray)
                                                var content = '<div class="modal-body" style="">'+
                                                    '<div style="border: 1px solid #d6d6d6;border-radius: 5px;margin-bottom: 25px;"><div class="work-prcs-title" id="op_user_show_info" style="margin-bottom: 20px;border: none;height: 22px;line-height: 22px;font-weight: normal;position: relative;"><img src="/img/gzlnum1.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="main.th.nextStep" />：<fmt:message code="main.th.currentStep" />'+flowStep+'<fmt:message code="workflow.th.step" /> ('+ globalData.flowTypeModel.flowName+') </span>'+
                                                    '<font color="#af0707" style="margin-left: 10px;"><div self_type="self" style="display:inline;">'+globalData.userName+'&nbsp;&nbsp;('+prcsFlag+')&nbsp;&nbsp;'+syncDeal+'</div>'+
                                                    '<div style="margin-top: -21px;margin-left: 274px;"></div></font></div><div class="work-prcs-block">'+
                                                    '<div class="work-prcs-content clearfix" style=""><div class="workflow-procs-nodes-wrap"><ul id="workPrcsData"  class="workflow-procs-nodes"><li class="workflow-node" style="" id="next_prcs_2">'+
                                                    prcsName+'<ol></ol> </li></ul></div><div class="workflow-procs-nodes-result-wrap">'+
                                                    '<ul id="work-next-prcs-block" class="workflow-procs-nodes-result" style="top: 0px;">'+workflowpricToArray+
                                                    '</ul></div>' +
                                                    '<div title="暂不办结本步骤，可继续办理" style="display: none;" class="turnTypeName turnType"><h1 style="margin-left:33px;line-height:40px">暂不办结本步骤，可继续办理</h1></div>'+
                                                    '</div></div></div>' +
                                                    '<div class="work-msg-block hide" id="viewbox" style="margin-bottom: 25px;display:none;"><div class="work-msg-title"><img src="/img/gzlnum2.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="work.th.add" /></span></div><div class="work-msg-content" style="display: block;position: relative;padding: 15px 10px;"><div class="cytitle">传阅人：</div><div class="clearfix" style="margin-left: 233px;"><textarea name="viewUserName" id="viewUserName" dataid="" username="" readonly="" style="width:468px;height: 60px;"></textarea>&nbsp;<a class="orgAdd" id="viewUserNameSelect" tarobj = "viewUserName" style="color: #3691da;margin-left: 5px;">选择</a>&nbsp;<a class="orgClear"  tarobj = "viewUserName" id="viewUserNameClear" style="color: #3691da;margin-left: 15px;">清空</a></div></div></div>'+
                                                    '<div class="work-msg-block hide"><div class="work-msg-title"><img src="/img/gzlnum3.png" style="position: absolute;top: 5px;"><span style="margin-left: 32px;"><fmt:message code="main.th.Sendmessage" /></span></div>'+
                                                    '<div class="work-msg-content" style="display: block;"><div class="clearfix">'+
                                                    '<div data_type="next" class="work-msg-op-title"><div class="gjtitles"><fmt:message code="workflow.th.nextstep" />：</div><span class="addactiveClass sms-check sms-bg sms-bg-static active" style="margin-left: 70px;" data-id="1" title="<fmt:message code="notice.th.remindermessage" />"></span><span class="xuanzhong xuanzhongactive"><fmt:message code="sms.th.remind" /></span><span  class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="2" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span><span class="xuanzhong xuanzhong1"><fmt:message code="adding.th.duanxin" /></span>'+
                                                    '</div>'+
                                                    '<div data_type="create" class="work-msg-op-title" style="width: 259px;"><div class="gjtitles"><fmt:message code="workflow.th.Initiator" />：</div><span data-id="3" class="addactiveClass sms-check sms-bg sms-bg-static" style="margin-left: 60px;" title="<fmt:message code="notice.th.remindermessage" />"></span><span class="xuanzhong" style="left: 87px;"><fmt:message code="sms.th.remind" /></span>'+
                                                    '<span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="4" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span><span class="xuanzhong xuanzhong1" style="left: 183px;"><fmt:message code="adding.th.duanxin" /></span></div>'+

                                                    '<div data_type="managers" class="work-msg-op-title" style="margin-right: 0;width:286px;"><div class="gjtitles" ><fmt:message code="doc.th.AllHandlers" />：</div><span data-id="5" class="addactiveClass sms-check sms-bg sms-bg-static" title="<fmt:message code="notice.th.remindermessage" />" style="margin-left: 90px;"></span><span class="xuanzhong" style="    left: 115px;"><fmt:message code="sms.th.remind" /></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="6" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span> <span class="xuanzhong xuanzhong1" style="left: 220px;"><fmt:message code="adding.th.duanxin" /></span></div> '+
                                                    '<div data_type="circulate" class="work-msg-op-title" style="margin-right: 0;width:286px;"><div class="gjtitles" >传阅人：</div><span data-id="8" class="addactiveClass sms-check sms-bg sms-bg-static active" title="<fmt:message code="notice.th.remindermessage" />" style="margin-left: 70px;"></span><span class="xuanzhong xuanzhongactive" style="    left: 96px;"><fmt:message code="sms.th.remind" /></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                                    '<span data-id="9" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendSMS" />"></span> <span class="xuanzhong xuanzhong1" style="left: 197px;"><fmt:message code="adding.th.duanxin" /></span></div> '+

                                                    '</div>'+
                                                    '<div class="clearfix" style="position: relative;margin: 10px 0;display: none;"><div class="cytitle" style="top: 15px;left: 0px;"><fmt:message code="main.th.RemindHandler" />：</div><div style="margin-left: 150px;"><input type="hidden" name="remind_others_id" id="remind_others_id" value="">'+
                                                    '<textarea name="remind_others_name" id="remind_others_name" readonly="" style="width:550px;height: 40px;"></textarea>&nbsp;'+
                                                    '<a class="orgAdd" id="others-add" style="color: #3691da;margin-left: 5px;"><fmt:message code="global.lang.select" /></a>&nbsp;<a class="orgClear" style="color: #3691da;margin-left: 5px;" id="others-clear" href="javascript:ClearUser("remind_others_id", "remind_others_name");"><fmt:message code="global.lang.empty" /></a></div>'+
                                                    '</div><div class="work-msg-sms-block" style="position: relative;margin-bottom: 10px;height: auto;"><div class="cytitle" style="top: 15px;left: 0px;"><fmt:message code="main.th.ReminderContent" />：</div><div style="margin-left: 150px;"><textarea style="width: 550px;height: 50px;padding: 7px;" name="SMS_CONTENT" id="SMS_CONTENT">'+tipMsg+'</textarea></div>'+
                                                    ' </div></div></div></div>';
                                            }
                                        }

                                        layer.open({
//                                        type: 1,
                                            /* skin: 'layui-layer-rim', //加上边框 */
                                            area: ['930px', '430px'],
                                            closeBtn: 0,
                                            title:'<span style="color: #fff;">'+titleName+'</span>',
                                            content: content,
                                            btn:['<fmt:message code="global.lang.ok" />', '<fmt:message code="depatement.th.quxiao" />'],
                                            success: function(layero,index){
                                                if(globalData.flowProcesses.syncDeal == 1&&$('#next_prcs_2 .prcsName').length > 1
                                                    &&$('#next_prcs_2 .prcsName').length -1 > $('.tipmsg').length){
                                                    var prcsidBox =  $('.prcsName_chang').attr('prcsid');
                                                    $('#userSelectBtn_'+prcsidBox).hide();
                                                    $('.prcsName_chang').removeClass('prcsName_chang').attr('check','0');
                                                }
                                                if (globalData.flowProcesses && globalData.flowProcesses.turnContinueYn == '1') {
                                                    $('.turnTypeName').show();
                                                }
                                                var firtnode = $('#next_prcs_2 .prcsName_chang');
                                                if(firtnode.attr('prcsid') == '0'&&!firtnode.hasClass('fatherSonFlow')){
                                                    $('#work-next-prcs-block li').hide();
                                                }
                                                $.ajax({
                                                    url:'/code/getCodeRemind',
                                                    type:'get',
                                                    datType:'json',
                                                    success:function(res){

                                                        var viewUsersd = $('#viewUserName').val();//传阅人
                                                        if(viewUsersd===','){
                                                            $('#viewUserName').val('');
                                                            $('#viewUserName').attr('username','');
                                                            $('#viewUserName').attr('dataid','');
                                                            $('#viewUserName').attr('user_id','');
                                                            $('#viewUserName').attr('userprivname','')
                                                        }

                                                        for(var i=0;i<res.obj.length;i++){
                                                            if(res.obj[i].codeName == "工作流：提醒流程发起人"||res.obj[i].codeName == "工作流：提醒流程所有人员"||res.obj[i].codeName == "工作流：提醒下一步经办人"){
                                                                if(res.obj[i].codeName == "工作流：提醒下一步经办人"){
                                                                    var j = 0;
                                                                }else if(res.obj[i].codeName == "工作流：提醒流程发起人"){
                                                                    var j = 1;
                                                                }else if(res.obj[i].codeName == "工作流：提醒流程所有人员"){
                                                                    var j = 2;
                                                                }
                                                                if(res.obj[i]!=null&&res.obj[i].isCan==1){
                                                                    $('.work-msg-op-title').eq(j).show();
                                                                    if(res.obj[i].isRemind==1){
                                                                        $('.work-msg-op-title').eq(j).find('.addactiveClass').eq(0).addClass('active');
                                                                        $('.work-msg-op-title').eq(j).find('.xuanzhong').eq(0).addClass('xuanzhongactive');
                                                                    }else{
                                                                        $('.work-msg-op-title').eq(j).find('.addactiveClass').eq(0).removeClass('active');
                                                                        $('.work-msg-op-title').eq(j).find('.xuanzhong').eq(0).removeClass('xuanzhongactive');
                                                                    }
                                                                    if(res.obj[i].isIphone==1){
                                                                        $('.work-msg-op-title').eq(j).find('.addactiveClass').eq(1).addClass('active');
                                                                        $('.work-msg-op-title').eq(j).find('.xuanzhong').eq(1).addClass('xuanzhongactive');
                                                                    }else{
                                                                        $('.work-msg-op-title').eq(j).find('.addactiveClass').eq(1).removeClass('active');
                                                                        $('.work-msg-op-title').eq(j).find('.xuanzhong').eq(1).removeClass('xuanzhongactive');
                                                                    }
                                                                }else{
                                                                    $('.work-msg-op-title').eq(j).hide().attr('canChoose',0)
                                                                }
                                                            }

                                                        }

                                                    }
                                                })

                                                if(globalData.isViewPriv == '1'){
                                                    $('#viewbox').show();
                                                    var userid = [];
                                                    var username = [];
                                                    if(globalData.listView){
                                                        globalData.listView.forEach(function(v,i){
                                                            userid.push(v.userId);
                                                            username.push(v.userName);
                                                        });
                                                    }

                                                    $('#viewUserName').attr('dataid',userid.join(',')+',');
                                                    $('#viewUserName').attr('username',username.join(',')+',');
                                                    $('#viewUserName').attr('user_id',userid.join(',')+',');
                                                    $('#viewUserName').val(username.join(',')+',');
                                                    $('#viewUserNameSelect').click(function(){
                                                        user_id = 'viewUserName';
                                                        $.popWindow("../../common/selectUser");
                                                    });
                                                    $('#viewUserNameClear').click(function(){
                                                        $('#viewUserName').val('');
                                                        $('#viewUserName').attr('username','');
                                                        $('#viewUserName').attr('dataid','');
                                                        $('#viewUserName').attr('user_id','');
                                                        $('#viewUserName').attr('userprivname','');
                                                    })

                                                    $('#others-clear').click(function(){
                                                        $('#remind_others_name').val('');
                                                        $('#remind_others_name').attr('username','');
                                                        $('#remind_others_name').attr('dataid','');
                                                        $('#remind_others_name').attr('user_id','');
                                                        $('#remind_others_name').attr('userprivname','');
                                                    })
                                                }else{
                                                    $('div[data_type="circulate"]').hide();
                                                    $('div[data_type="circulate"]').find('.xuanzhong').removeClass('xuanzhongactive')
                                                    $('div[data_type="circulate"]').find('.sms-bg-static').removeClass('active')
                                                }

                                                if(! $.isEmptyObject(flowSelectAutoList)){  //判断是否可以修改主办人
                                                    $('.userSelectBtn').each(function(i,v){
                                                        var pids = $(this).attr('pid');
                                                        if(flowSelectAutoList[pids]&&flowSelectAutoList[pids].userLock==0){
                                                            $('#userSelectBtn_'+pids+'').find('#TOP_FLAG_SHOW2 span').css('color','#333')
                                                            $('#TOP_FLAG_SHOW2').click(function(){
                                                                globalData.topDefault = 0;
                                                                alert('您无权修改主办人相关选项');
                                                            })
                                                        }else{
                                                            $('#userSelectBtn_'+pids+'').find('#TOP_FLAG_SHOW2 span').css('color','blue')
                                                            $('.sponsor').mousemove(function(){
                                                                $(this).parent().find('.TOP_FLAG_SHOW2_menu').show();
                                                            })

                                                            $('.attach_div a').mousemove(function(){
                                                                $(this).parent().show();
                                                            })

                                                            $('.attach_div').mouseout(function(e){
                                                                e.preventDefault();
                                                                $('.attach_div').hide();
                                                            })

                                                            $('.attach_div a').click(function(){
                                                                var _this =  $(this);
                                                                var pid = $(this).parent().attr('pid');
                                                                var pids = $('.userSelectBtn').eq(i).attr('pid');
                                                                if(pid == pids){
                                                                    var index = _this.index();
                                                                    $(this).parents('.sponsor').find('#TOP_FLAG_SHOW2 span').html($(this).html());
                                                                    globalData.topDefault = index;
                                                                    $(this).parent().find('#TOP_FLAG_SHOW2').attr('dataType',index);
                                                                    $('.userSelectBtn').eq(i).attr('topdefault',index);
                                                                    $('#jingban_'+pids).attr('topdefault',index);
                                                                    $('.attach_div ').hide();
                                                                    if(index == 1 || index == 2){
                                                                        $(this).parents('#host_op_block_div2').find('#remind_name_'+pids).hide();
                                                                    }else{
                                                                        $(this).parents('#host_op_block_div2').find('#remind_name_'+pids).show();
                                                                    }
                                                                }
                                                            })
                                                        }
                                                    })
                                                };

                                                $('.xuanzhong').click(function(){
                                                    $(this).prev().click();
                                                });

                                                $('.addactiveClass').click(function () {
                                                    if($(this).hasClass('active')){
                                                        $(this).removeClass('active');
                                                        $(this).next().removeClass('xuanzhongactive');
                                                    }else {
                                                        $(this).addClass('active');
                                                        $(this).next().addClass('xuanzhongactive');
                                                    }
                                                });
                                                //调取选人控件
                                                $('#work-next-prcs-block').on('click','.userSelectBtn',function(){
                                                    var pid = $(this).attr('pid');
                                                    var topdefault = $(this).attr('topdefault');
                                                    UserItemMain = 'remind_name_'+pid;
                                                    UserItem = 'jingban_'+pid;
                                                    var option = flowSelectAutoList[pid];
                                                    allprcsUserlist = '';
                                                    prcsPrivlist = '';
                                                    prcsUserlist = '';
                                                    prcsDeptlist = '';
                                                    var selectUserUrl = '';
                                                    if($(this).parents('.workflow-node-result').hasClass('SonFlowID')){
                                                        // $.popWindow("/common/selectUserWorkFlowNew?topdefault="+topdefault+"&flowId="+$(this).parents('.workflow-node-result').attr('childflow')+"&deptNo=&flowPrcs=1");
                                                        selectUserUrl = "/common/selectUserWorkFlowNew?topdefault="+topdefault+"&flowId="+$(this).parents('.workflow-node-result').attr('childflow')+"&deptNo=&flowPrcs=1";
                                                    }else{
                                                        if($(this).hasClass('fatherSonFlow')){
                                                            // $.popWindow("/common/selectUserWorkFlowNew?topdefault="+topdefault+"&flowId="+$(this).attr('flowid')+"&deptNo=&flowPrcs="+pid);
                                                            selectUserUrl = "/common/selectUserWorkFlowNew?topdefault="+topdefault+"&flowId="+$(this).attr('flowid')+"&deptNo=&flowPrcs="+pid;
                                                        }else{
                                                            // $.popWindow("/common/selectUserWorkFlowNew?topdefault="+topdefault+"&flowId="+dataFind.flowId+"&deptNo="+dataFind.deptNo+"&flowPrcs="+pid);
                                                            selectUserUrl = "/common/selectUserWorkFlowNew?topdefault="+topdefault+"&flowId="+dataFind.flowId+"&deptNo="+dataFind.deptNo+"&flowPrcs="+pid;
                                                        }
                                                    }
                                                    selectUsreLayerIndex = layer.open({
                                                        type: 2,
                                                        title: '<span style="color: #fff;">选择用户</span>',
                                                        content: selectUserUrl,
                                                        area: ['65%', '80%']
                                                    })
                                                });

                                                $('#workPrcsData .prcsName').each(function(){
                                                    var _this = $(this);
                                                    var prcsid = _this.attr('prcsid');
                                                    var obj = flowSelectAutoList[prcsid] || {};
                                                    var autoTypelist = obj.autoTypelist || [] ;
                                                    var mainprcName = '';
                                                    var mainprcId = '';
                                                    var mainuserPrivName = '';
                                                    var maindeptName = '';
                                                    var overprcName = '';
                                                    var overprcId = '';
                                                    var overuserPrivName = '';
                                                    var overdeptName = '';
                                                    if(autoTypelist && (autoTypelist instanceof Array)) {
                                                        if(autoTypelist.length > 1){
                                                            autoTypelist.forEach(function (v, i) {
                                                                if(v.opFlag == 1){
                                                                    mainprcName = v.userName + ',';
                                                                    mainprcId = v.userId + ',';
                                                                    mainuserPrivName = v.userPrivName + ',';
                                                                    maindeptName = v.deptName + ',';
                                                                }else{

                                                                }
                                                                overprcName += v.userName + ',';
                                                                overprcId += v.userId + ',';
                                                                overuserPrivName += v.userPrivName + ',';
                                                                overdeptName += v.deptName + ',';
                                                            });
                                                        }else{
                                                            autoTypelist.forEach(function (v, i) {
                                                                mainprcName += v.userName + ',';
                                                                mainprcId += v.userId + ',';
                                                                mainuserPrivName = v.userPrivName + ',';
                                                                maindeptName = v.deptName + ',';
                                                                overprcName += v.userName + ',';
                                                                overprcId += v.userId + ',';
                                                                overuserPrivName += v.userPrivName + ',';
                                                                overdeptName += v.deptName + ',';
                                                            });
                                                        }

                                                    }
                                                    $('#remind_name_'+prcsid).val(mainprcName);
                                                    $('#remind_name_'+prcsid).attr({
                                                        'user_id':mainprcId,
                                                        'userPrivName':mainuserPrivName,
                                                        'deptName':maindeptName
                                                    });
                                                    $('#jingban_'+prcsid).val(overprcName);
                                                    $('#jingban_'+prcsid).attr({
                                                        'user_id':overprcId,
                                                        'userPrivName':overuserPrivName,
                                                        'deptName':overdeptName
                                                    });
                                                });
                                                //底部选择人员
                                                $('#others-add').on('click',function(){
                                                    user_id='remind_others_name';
                                                    $.popWindow("../../common/selectUser");
                                                });

                                                //点击下一步骤，样式的改变
                                                if(globalData.flowProcesses.syncDeal == 2){//强制并发
                                                    $('#work-next-prcs-block li').show();
                                                    for(var i=0;i<$('#workPrcsData .prcsName_chang').length;i++){
                                                        var prcsid = $('#workPrcsData .prcsName_chang').eq(i).attr('prcsid');
                                                        if(prcsid == 0&&$('#workPrcsData .prcsName_chang').length != 1){
                                                            $('#workPrcsData .prcsName_chang').eq(i).removeClass('prcsName_chang');
                                                        }
                                                    }
                                                    $('.workflow-procs-nodes-wrap').on('click','.prcsName',function() {
                                                        var _this = $(this);
                                                        if (_this.find('.tipmsg').length > 0) {
                                                            var msg = _this.find('.tipmsg').attr('msg') || '不符合条件！';
                                                            alert(msg);
                                                        }
                                                    });
                                                }else if(globalData.flowProcesses.syncDeal == 1){//允许并发
                                                    $('.workflow-procs-nodes-wrap').on('click','.prcsName',function(){
                                                        var _this = $(this);
                                                        if(_this.find('.tipmsg').length>0){
                                                            var msg = _this.find('.tipmsg').attr('msg') || '不符合条件！';
                                                            alert(msg);
                                                        }else{

                                                                var $next = $('.work-msg-content .clearfix').eq(1).find('[data_type=next]');
                                                                var $create = $('.work-msg-content .clearfix').eq(1).find('[data_type=create]');
                                                                var $managers = $('.work-msg-content .clearfix').eq(1).find('[data_type=managers]');
                                                                var nextprcsid = _this.attr("prcsid");
                                                                if(_this.attr('class').indexOf('prcsName_chang') == -1){   //点击未选中的步骤
                                                                    if($('.prcsName_chang').attr('prcsid') == 0){          //点击时，选中的是结束流程
                                                                        $('.prcsName_chang').removeClass('prcsName_chang').attr('check','0');
                                                                    }
                                                                    _this.addClass('prcsName_chang');                        //点击步骤操作
                                                                    _this.attr('check','1');
                                                                    $('#userSelectBtn_'+nextprcsid).show();
                                                                    // $next.show();
                                                                    // $('.gjtitles').show();
                                                                    // $('.xuanzhong ').show();
                                                                    // $('.addactiveClass').eq(0).addClass('active');
                                                                    // for(var i=0;i<$('.addactiveClass').length;i++){
                                                                    //     $('.addactiveClass').eq(i).show();
                                                                    // }
                                                                    if(nextprcsid == 0){                                       //点击结束流程
                                                                        var len = $('.prcsName_chang').length;
                                                                        for(var i=len-1;i>-1;i--){
                                                                            var prcsid = $('.prcsName_chang').eq(i).attr('prcsid');
                                                                            $('.prcsName_chang').eq(i).removeClass('prcsName_chang').attr('check','0');
                                                                            $('#userSelectBtn_'+ prcsid +'').hide();
                                                                        }
                                                                        // if($('#next_prcs_2 .prcsName_chang').length == 0){
                                                                        //     $next.find('.gjtitles').hide();
                                                                        //     $next.find('.xuanzhong').hide();
                                                                        //     $next.find('.addactiveClass').hide().removeClass('active');
                                                                        //     $next.hide();
                                                                        //     if($create.length != 0){
                                                                        //         $create.find('.addactiveClass').eq(0).addClass('active');
                                                                        //         $create.find('.xuanzhong').eq(0).addClass('xuanzhongactive');
                                                                        //     }
                                                                        //     if($managers.length != 0){
                                                                        //         $managers.find('.addactiveClass').eq(0).addClass('active');
                                                                        //         $managers.find('.xuanzhong').eq(0).addClass('xuanzhongactive');
                                                                        //     }
                                                                        // }
                                                                        _this.addClass('prcsName_chang');
                                                                        _this.attr('check','1');
                                                                    }
                                                                }else{                                                         //点击选中的步骤
                                                                    if($('.prcsName_chang').length>1){                       //选中的步骤数大于一个
                                                                        _this.removeClass('prcsName_chang');
                                                                        _this.attr('check','0');
                                                                        $('#userSelectBtn_'+nextprcsid).hide();
                                                                    }
                                                                }

                                                        }
                                                    });
                                                }else{
                                                    $('.workflow-procs-nodes-wrap').on('click','.prcsName',function(){
                                                        var _this = $(this);
                                                        if(_this.find('.tipmsg').length>0){
                                                            var msg = _this.find('.tipmsg').attr('msg') || '不符合条件！';
                                                            _this.find('.tipmsg').hide();
                                                            alert(msg);
                                                        }else{
                                                            var $next = $('.work-msg-content .clearfix').eq(1).find('[data_type=next]');
                                                            var $create = $('.work-msg-content .clearfix').eq(1).find('[data_type=create]');
                                                            var $managers = $('.work-msg-content .clearfix').eq(1).find('[data_type=managers]');
                                                            if(nextFlowid != 0){
                                                                _this.siblings().removeClass('prcsName_chang');
                                                                _this.addClass('prcsName_chang');
                                                                _this.siblings().attr('check','0');
                                                                _this.attr('check','1');
                                                                var nextFlowid = _this.attr("prcsid");
                                                                $('#work-next-prcs-block .workflow-node-result').hide();
                                                                $('#userSelectBtn_'+nextFlowid).show();
                                                                // $next.show();
                                                                // $('.gjtitles').show();
                                                                // $('.xuanzhong ').show();
                                                                // $('.addactiveClass').eq(0).addClass('active');
                                                                // for(var i=0;i<$('.addactiveClass').length;i++){
                                                                //     $('.addactiveClass').eq(i).show();
                                                                // }
                                                                /*************父子流程判断start*********************************/
                                                                if(_this.hasClass('fatherSonFlow')){
                                                                    $('.fatherSonFlowID').show();
                                                                }else{
                                                                    // if($(this).attr('prcsid') == 0){
                                                                    //     $next.find('.gjtitles').hide();
                                                                    //     $next.find('.xuanzhong').hide();
                                                                    //     $next.find('.addactiveClass').hide().removeClass('active');
                                                                    //     $next.hide();
                                                                    //     if($create.length != 0){
                                                                    //         $create.find('.addactiveClass').eq(0).addClass('active');
                                                                    //         $create.find('.xuanzhong').eq(0).addClass('xuanzhongactive');
                                                                    //     }
                                                                    //     if($managers.length != 0){
                                                                    //         $managers.find('.addactiveClass').eq(0).addClass('active');
                                                                    //         $managers.find('.xuanzhong').eq(0).addClass('xuanzhongactive');
                                                                    //     }
                                                                    // }
                                                                }
                                                                /*************父子流程判断end*********************************/
                                                            }else{
                                                                $('#work-next-prcs-block li').hide();
                                                            }
                                                        }
                                                    })
                                                }
                                            },
                                            yes: function(index, layero){
                                                var layerLoadindex = layer.load(1);
                                                //按钮【按钮三】的回调
                                                //新建工作之后的保存接口，跳转到我的工作页面
                                                var ret=globalData.flowRun;
                                                var ret3=globalData.flowRunPrcs;
                                                var listTurnPriv = globalData.listTurnPriv;
                                                var checkTurnPriv = globalData.checkTurnPriv;
                                                var pId = [];
                                                var beginUser = [];
                                                var jingbanUser = [];
                                                var flag = true;
                                                var viewUser = $('#viewUserName').attr('user_id') ||'';//传阅人
                                                var parentflag = false;
                                                $('#workPrcsData .prcsName_chang').each(function(){
                                                    var prcsid = $(this).attr('prcsid');
                                                    pId.push(prcsid);
                                                    /****************父子流程判断经办人主办人的功能start***************************/
                                                    if(prcsid == '0'&&$(this).hasClass('fatherSonFlow')){
                                                        prcsid = $('.fatherSonFlowID').attr('id').split('userSelectBtn_')[1];
                                                        var bu = $('#remind_name_'+prcsid).attr('user_id');
                                                        var topdefault = $('#jingban_'+prcsid).attr('topdefault');
                                                        parentflag = true;
                                                        /****************父子流程经办人主办人功能end***************************/
                                                    }else{
                                                        var bu = $('#remind_name_'+prcsid).attr('user_id');
                                                        var topdefault = $('#jingban_'+prcsid).attr('topdefault');
                                                    }


                                                    if(bu && bu.indexOf(',') > -1){
                                                        bu = bu.split(',')[0];
                                                    }
                                                    if(topdefault == 1||topdefault == 2){
                                                        bu = "";
                                                    }else{
                                                        if(bu == ''){
                                                            flag = false;
                                                        }
                                                    }
                                                    if($('#jingban_'+prcsid).attr('user_id') === ''){
                                                        flag = false;
                                                    }
                                                    beginUser.push(bu);
                                                    jingbanUser.push($('#jingban_'+prcsid).attr('user_id'));
                                                });

                                                beginUser = beginUser.join(',');
//                                            判断主办人是否允许强制转交
                                                var turnStr=""
                                                if(listTurnPriv != undefined){
                                                    for(var i = 0;i<listTurnPriv.length;i++){
                                                        if(listTurnPriv[i].prcsFlag == '1' || listTurnPriv[i].prcsFlag == '2'){
                                                            turnStr += ' ['+listTurnPriv[i].userName+'] '
                                                        }
                                                    }
                                                }
                                                if( !flag &&$('#next_prcs_2 .prcsName_chang').find('h1').text()!='<fmt:message code="main.th.EndProcess" />'){
                                                    $.layerMsg({content:'请选择主办人或经办人！',icon:0},function(){
                                                        layer.close(layerLoadindex);
                                                        return false;
                                                    });
                                                }else if(checkTurnPriv == '0' && turnStr != ""){
                                                    $.layerMsg({content:'经办人'+turnStr+'尚未办理完毕，不能转交流程',icon:0},function(){
                                                        layer.close(layerLoadindex);
                                                        return false;
                                                    });
                                                }else{
                                                    if(pId.length == 0) {alert('无符合条件的流程步骤!'); layer.close(layerLoadindex);return false;}else {
                                                        var str = ""
                                                        for (var i = 0; i < $('.workflow-node-result').length; i++) {
                                                            if ($('.workflow-node-result').eq(i).css('display') != 'none') {
                                                                str += $('.workflow-node-result').eq(i).find('textarea').attr('topdefault') + ','
                                                            }
                                                        }
                                                        if ($('#next_prcs_2 .prcsName_chang').find('h1').text() == '<fmt:message code="main.th.EndProcess" />') {
                                                            savedData = {
                                                                flowId: ret.flowId,
                                                                runId: ret.runId,
                                                                runName: ret.runName,
                                                                beginTime: ret.beginTime,
                                                                beginUser: beginUser,
                                                                prcsId: ret3.prcsId,
                                                                prcsflag: 1,
                                                                flowPrcs: pId.join(','),
                                                                jingbanUser: jingbanUser.join('|'),
                                                                tableName: tableName,
                                                                tabId: tabId,
                                                                currentPrcsId: prcsId,
                                                                flowStep: flowStep,
                                                                viewUser: viewUser,//viewUser
                                                                topDefault: str,
                                                                htmlContent: $('#client').html(),
                                                            }
                                                        } else {
                                                            savedData = {
                                                                flowId: ret.flowId,
                                                                runId: ret.runId,
                                                                runName: ret.runName,
                                                                beginTime: ret.beginTime,
                                                                beginUser: beginUser,
                                                                prcsId: ret3.prcsId,
                                                                flowPrcs: pId.join(','),
                                                                prcsflag: 1,
                                                                jingbanUser: jingbanUser.join('|'),
                                                                tableName: tableName,
                                                                tabId: tabId,
                                                                currentPrcsId: prcsId,
                                                                flowStep: flowStep,
                                                                viewUser: viewUser,
                                                                topDefault: str,
                                                                htmlContent: $('#client').html(),
                                                            }
                                                        }

                                                        var smsTypes = ''
                                                        var smsTypesArr = $('.addactiveClass');
                                                        for (var i = 0; i < smsTypesArr.length; i++) {
                                                            if ($(smsTypesArr[i]).hasClass('active')) {
                                                                smsTypes += $(smsTypesArr[i]).attr('data-id') + ','
                                                            }
                                                        }
                                                        savedData.smsType = smsTypes;
                                                        savedData.smsContent = $('#SMS_CONTENT').val()
                                                        savedData.orgAdd = $('#remind_others_name').attr('user_id') || '';
                                                        if($('.work-prcs-content .turnType').hasClass('turnTypeName_chang')){
                                                            savedData.turnType=1
                                                        }else{
                                                            savedData.turnType=0
                                                        }
                                                        //保存的接口
                                                        $.ajax({
                                                            type: "post",
                                                            url: "../../workflow/work/saveWork",
                                                            dataType: 'JSON',
                                                            data: savedData,
                                                            success: function (obj) {
                                                                if(obj.obj1!=''&&obj.obj1!=undefined) {
                                                                    $.layerMsg({content: '正在生成公告，请稍等...', icon: 1, time:2000})
                                                                    setTimeout(function () {
                                                                        window.location.href = '/notice/newAndEdit?type=edit&notifyId=' + obj.obj1
                                                                    }, 2000);
                                                                }else{
                                                                    if (obj.flag == true) {
                                                                        $.layerMsg({
                                                                            content: '<fmt:message code="workflow.turn.ok" />',
                                                                            icon: 1
                                                                        }, function () {
                                                                            layer.close(layerLoadindex);
																			//console.log(11111);
                                                                            //window.close();
																			window.history.go(-1);
                                                                            if (parent.opener.openRold != undefined) {
                                                                                parent.opener.openRold()
                                                                            }
                                                                            if (parent.opener.runWorkListPage != undefined) {
                                                                                parent.opener.runWorkListPage();
                                                                            }
                                                                        });
                                                                    } else {
                                                                        $.layerMsg({
                                                                            content: '<fmt:message code="meet.th.SaveFailed" />！',
                                                                            icon: 1
                                                                        }, function () {
                                                                            layer.close(layerLoadindex);
                                                                        });
                                                                    }
                                                                }


                                                            }
                                                        });
                                                        if (parentflag) {
                                                            savedData.parentFlowPrcs = $('.fatherSonFlowID').attr('id').split('userSelectBtn_')[1];
                                                            $.ajax({
                                                                type: "post",
                                                                url: "../../workflow/work/finishSonReturnParent",
                                                                dataType: 'JSON',
                                                                async: false,
                                                                data: savedData,
                                                                success: function (obj) {
                                                                }
                                                            });
                                                        }
                                                    }
                                                }
                                            },
                                            btn2:function (index) {
                                                layer.close();
                                                // if(zw.window.showRight!=undefined){
                                                //     zw.window.showRight();
                                                // }
                                            }
                                        });
                                    }else{

                                        if(res.msg == ""){
                                            alert('不符合条件')
                                        }else{
                                            alert(res.msg)
                                        }
                                        layer.close(indexss);
                                    }
                                });
                            },
                            error:function(obj){
                                console.log('error')
                            }
                        });
                    }
                })


            });
        }
        //暂不办结本步骤，可继续办理样式变化
        $(document).on('click','.turnType',function () {
            if($(this).hasClass('turnTypeName')){
                $(this).removeClass('turnTypeName').addClass('turnTypeName_chang')
            }else{
                $(this).removeClass('turnTypeName_chang').addClass('turnTypeName')
            }
        })
        saveFlowData = function (cb,isCheckOpt) {
            WebSign_Submit(sign_arr);
            markFunc();
            var isCheck = true;
            if(isCheckOpt && isCheckOpt=='noCheck'){
                isCheck = false;
            }
            var listing = false;
            var flowfun = globalData.flowRun;
            var form_item=$('.cont_form .form_item');
            var realData=[];
            var realDataTwo = [];
            var radioArr = {};
            var modifydata =[];
            var modifydataObject = {};
            var flag = false;
            var arr = [];
            var form_data = false;
            var form_title = '';
            var countersignData = '';
            var thisprcsItem = [],thisprcsItemAuto = [];
            if(globalData.flowProcesses){
                if(globalData.flowProcesses.prcsItem&&globalData.flowProcesses.prcsItem != ''){
                    var thisprcsItem = globalData.flowProcesses.prcsItem.split(',');
                }
                if(globalData.flowProcesses.prcsItemAuto&&globalData.flowProcesses.prcsItemAuto != ''){
                    var thisprcsItemAuto = globalData.flowProcesses.prcsItemAuto.split(',');
                }
            }
            for(var i=0;i<form_item.length;i++){
                var baseData={};
                var baseDataTwo = {};
                var value="";
                var obj = form_item.eq(i);
                var datatype = obj.attr("data-type");
                var key = obj.attr("name");
                var title = obj.attr('title')||'';
                if(key == ''||key == undefined){
                    var j = i+1;
                    form_data = true;
                    form_title += obj.attr("title")+',';

                }
                var ismust = obj.attr('ismust');
                if(datatype=="select"){
                    if(obj.val() == null){
                        value = '';
                    }else{
                        value= obj.val()==0?'':form_item.eq(i).val();
                    }

                }else if(datatype=="textarea"){
                    value=obj.val();
                    if(obj.attr('rich') == 1){
                        var id = obj.attr('id').split('DATA_')[1];
                        value = UE.getEditor('container'+id).getContent()||obj.val();
                    }else if(obj.hasClass('countersignature_item')) {
                        if(ismust == 'true'&&$('.countersignature_itemhide').length == 0){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                            layer.msg('请签名!', {icon: 1});
                            return false;
                        }else{
                            saveCSNtr_item(obj);
                        }
                        value=' ';
                    }
                }else if(datatype=="countersignature_item"){
                    if(!deleteITEMcountersignature_item){
                        if(ismust == 'true'&&$('.countersignature_itemhide').length == 0){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                            layer.msg('请签名!', {icon: 1});
                            return false;
                        }else{
                            saveCSNtr_item(obj);
                        }
                    }
                    value=' ';
                }else if(datatype=="text"){
                    value=obj.val();
                }else if(datatype=="markformItem"){
                    value=obj.val();
                }else if(datatype=="checkbox"){
                    if(obj.is(':checked')){
                        value = '1';
                    }else{
                        value = '0'
                    }
                }else if(datatype=="macros"){
                    if(obj.attr('type') == "text" || obj[0].type == 'text'){
                        if(obj.attr('datafld')=='SYS_USERNAME'&&obj.attr('orgsignImg')==1){
                            if(obj.prev().find('img').attr('src')!=undefined&&obj.prev().find('img').attr('src')!=''){
                                value = obj.prev().find('img').attr('src')
                            }else{
                                if(obj.val()=='{macros}'){
                                    var datafld = obj.attr('datafld');
                                    value = workForm.tool.getMacrosData(datafld)||''
                                }else{
                                    value= obj.val();
                                }
                            }
                        }else{
                            if(obj.val()=='{macros}'){
                                var datafld = obj.attr('datafld');
                                value = workForm.tool.getMacrosData(datafld)||''
                            }else{
                                value= obj.val();
                            }
                        }

                    }else{
                        if(obj.val() > -1 || obj.val()!=""){
                            value = obj.val()+'_'+obj.find("option:selected").text();
                        }
                    }
                }else if(datatype == "radio"){
                    var name = obj.attr('name');
                    if(!radioArr[obj.attr('name')]){
                        radioArr[obj.attr('name')] = true;
                        if($("input[name='"+name+"']:checked").length>0){
                            value= $("input[name='"+name+"']:checked").val();
                        }else{
                            value = "";
                        }
                    }else{
                        continue;
                    }
                }else if(datatype == "macrossign"){
                    if (obj.attr('datafld') == 'SYS_FLOW_CONNECTFLOW' && obj.attr('flowtype') == 1){
                        value = obj.val();
                    } else {
                        value = obj.html();
                    }

                }else if(datatype == "fileupload"){
                    var name = obj.attr('name');
                    $('img[name='+name+']').each(function(i,v){
                        var atturl = $(v).attr('atturl');
                        var url = $(v).attr('src')||'';
                        if(atturl != undefined && atturl != '' && atturl.indexOf(',') > -1){
                            atturl = atturl.replace(/\,/g, "%2c");
                        }
                        if(url.indexOf('/img/fileupload.png') == -1&&url.indexOf('/img/icon_uploadimg.png') == -1){
                            value+= (atturl+'*');
                        }
                    })
                }else if(datatype == "imgupload"){
                    var name = obj.attr('name');
                    $('img[name='+name+']').each(function(i,v){
                        var url = $(v).attr('src')||'';
                        if(url.indexOf('/img/icon_uploadimg.png') == -1){
                            var str = decodeURI(url);
                            var strs = str.split('&ATTACHMENT_NAME=')[0];
                            var name = str.split('&ATTACHMENT_NAME=')[1].split('&FILESIZE=')[0];
                            var attName = decodeURI(name).replace(/\%2b/g, "+").replace(/\%40/g,"@").replace(/\%23/g,"#").replace(/\%26/g,"&").replace(/\%2F/g,"/").replace(/\%3F/g,"?").replace(/\%ef%bf%a5/g,"￥").replace(/\%24/g,"$").replace(/\%ef%bc%81/g,"！").replace(/\%ef%bc%88/g,"（").replace(/\%ef%bc%89/g,"）").replace(/\%e2%80%a6%e2%80%a6/g,"…");
                            var atturl =strs+"&ATTACHMENT_NAME="+attName+"&FILESIZE="+str.split('&ATTACHMENT_NAME=')[1].split('&FILESIZE=')[1];
                            if(atturl != undefined && atturl != '' && atturl.indexOf(',') > -1){
                                atturl = atturl.replace(/\,/g, "%2c");
                            }
                            value+= (atturl+'*');
                        }
                    })
                }else if(datatype == "sign"){
                    var valueSign = obj.val().trim();
                    var pre = obj.prev();
                    countersignData += obj.attr('name')+',';
                    var $eiderarea = pre.find('.eiderarea').last();
                    if(valueSign){
                        $eiderarea.find('.remove_sign').css('display','none');
                        if (!$eiderarea.attr('time_stamp')) {
                            var timeStamp = new Date().getTime();
                            $eiderarea.attr('time_stamp', timeStamp);
                        }
                        value = Mustache.render($eiderarea.prop("outerHTML"),{content:''});
                    } else {
                        // var signHtml = $eiderarea.prop("outerHTML");
                        // var content = signHtml.match(/>(\S*?)<br>/)[1];
                        // if (content.indexOf('{{content}}') == -1 && content.trim() != '') {
                        //     // var $ele = $($(ele).prop("outerHTML"));
                        //     $eiderarea.find('.remove_sign').css('display','none');
                        //     value = Mustache.render($eiderarea.prop("outerHTML"),{content:''});
                        // }
                        value = "";
                    }
                }else if(datatype == "userselect"){
                    if(obj.attr('user_id')){
                        value = (obj.attr('user_id')||'')+'|'+ (obj.attr('username')||'');
                    }else{
                        value = obj.attr('username')||'';
                    }

                }else if(datatype == "deptselect"){
                    if(obj.attr('deptid')){
                        value= (obj.attr('deptid') || '')+'|'+(obj.attr('deptname')||'');
                    }else{
                        value = "";
                    }
                }else if(datatype == "kgsign"){
                    value = (obj.attr('signatureId') || '');
                }else if(datatype == "listing"){
                    var vtrStr = [];
                    var vsumStr = [];
                    obj.find('tr').each(function(){
                        if($(this).attr('class') != 'listhead' && $(this).attr('class')!= 'listfoot'){
                            var  listTdObj = $(this).find('td');
                            if($(this).attr('class') == 'listsum'){
                                listTdObj.each(function (i,v) {
                                    var _this = $(v);
                                    if(_this.attr('class')!='sumtitle'){
                                        if(_this.html() !=''&&_this.html() !='0'){
                                            listing = true;
                                        }
                                        vsumStr.push(_this.html());
                                    }
                                });
                            }else{
                                var vtdStr = [];
                                listTdObj.each(function (i,v) {
                                    var _this = $(v);
                                    var listtype = $(v).attr('listtype');
                                    switch (listtype){
                                        case 'text':
                                            if(_this.find('input').val() !=''&&_this.find('input').val() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(_this.find('input').val());
                                            break;
                                        case 'textarea':
                                            if(_this.find('textarea').val() !=''&&_this.find('textarea').val() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(_this.find('textarea').val());
                                            break;
                                        case 'select':
                                            if(_this.find('select').val() !=''&&_this.find('select').val() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(_this.find('select').val());
                                            break;
                                        case 'radio':
                                            var name = _this.find('input').eq(0).attr('name');
                                            if($('input[name="'+name+'"]:checked').val() !=''&&$('input[name="'+name+'"]:checked').val() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push($('input[name="'+name+'"]:checked').val());
                                            break;
                                        case 'checkbox':
                                            var checkboxStr = [];
                                            _this.find('input:checked').each(function(i,v){
                                                checkboxStr.push($(v).attr('value'));
                                            });
                                            if(checkboxStr.join(',') !=''&&checkboxStr.join(',') !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(checkboxStr.join(','));
                                            break;
                                        case 'datetime':
                                            if(_this.find('input').val() !=''&&_this.find('input').val() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(_this.find('input').val());
                                            break;
                                        case 'dateAndTime':
                                            if(_this.find('input').val() !=''&&_this.find('input').val() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(_this.find('input').val());
                                            break;
                                        case 'formula':
                                            if(_this.text() !=''&&_this.text() !='0'){
                                                listing = true;
                                            }
                                            vtdStr.push(_this.text())
                                            break;
                                        default:
                                    }

                                });
                                vtrStr.push(vtdStr.join('`'))
                            }

                        }
                    });
                    value = vtrStr.join('\r\n') +'|'+vsumStr.join('`');
                }else if(datatype == 'readcomments'){
                    value = obj.val();
                }else{
                    value = obj.val();
                }

                var isMustValue = value;
                if(datatype == 'sign'){
                    isMustValue = '';
                    // 获取输入框的值
                    var valueSign = obj.val().trim();

                    // 有值跳过
                    if(valueSign){
                        isMustValue = valueSign;
                    }else{ // 无值，需要判断当前用户当前步骤是否填写过意见
                        var pre = obj.prev();
                        var $eiderarea = pre.find('.eiderarea');
                        var flowRunPrcs = workForm.option.flowRunPrcs;
                        $eiderarea.each(function(index, ele){
                            if ($(this).attr('user_id') == flowRunPrcs.userId && $(this).attr('prcs_id') == flowRunPrcs.flowPrcs) {
                                var signHtml = $(ele).prop("outerHTML");
                                // var content = signHtml.match(/>(\S*?)<br>/)[1];
                                var contentArr = signHtml.split(/>/);
                                var content = contentArr[1].split(/</)[0];
                                if (content.indexOf('{{content}}') == -1 && content.trim() != '') {
                                    isMustValue += content
                                }
                            }
                        });
                    }
                }
                if(datatype == 'listing'){
                    if(!listing) {
                        isMustValue = '';
                    }
                }
                //针对复选框控件 isMustValue必须等于1或者0 所以需要特殊处理下必填条件下 isMustValue的值
                if(datatype == 'checkbox'){
                    if(isMustValue == '0'){
                        isMustValue = '';
                    }
                }
                //针对宏部门列表控件 isMustValue在选择时 值为“_请选择部门” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_DEPT'){
                    if(isMustValue == '_请选择部门'){
                        isMustValue = '';
                    }
                }
                //针对部门人员（本部门）列表控件 isMustValue在选择时 值为“_请选择人员” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_DEPT_PERSON'){
                    if(isMustValue == '_请选择人员'){
                        isMustValue = '';
                    }
                }
                //针对宏人员列表控件 isMustValue在选择时 值为“_请选择人员” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_USER'){
                    if(isMustValue == '_请选择人员'){
                        isMustValue = '';
                    }
                }
                //针对宏角色列表控件 isMustValue在选择时 值为“_请选择主角色” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_PRIV_ONLY'){
                    if(isMustValue == '_请选择主角色'){
                        isMustValue = '';
                    }
                }
                //针对宏辅助角色列表控件 isMustValue在选择时 值为“_请选择辅助角色” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_PRIV_OTHER'){
                    if(isMustValue == '_请选择辅助角色'){
                        isMustValue = '';
                    }
                }
                //针对宏流程设置所有经办人列表控件 isMustValue在选择时 值为“_请选择” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_PRCSUSER1'){
                    if(isMustValue == '_请选择'){
                        isMustValue = '';
                    }
                }
                //针对宏本步骤设置经办人列表控件 isMustValue在选择时 值为“_请选择” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_PRCSUSER2'){
                    if(isMustValue == '_请选择'){
                        isMustValue = '';
                    }
                }
                //针对宏部门主管（本部门）列表控件 isMustValue在选择时 值为“_请选择人员” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_MANAGER1'){
                    if(isMustValue == '_请选择人员'){
                        isMustValue = '';
                    }
                }
                //针对宏部门主管（上级部门）列表控件 isMustValue在选择时 值为“_请选择人员” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_MANAGER2'){
                    if(isMustValue == '_请选择人员'){
                        isMustValue = '';
                    }
                }
                //针对宏部门主管（一级部门）列表控件 isMustValue在选择时 值为“_请选择人员” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_MANAGER3'){
                    if(isMustValue == '_请选择人员'){
                        isMustValue = '';
                    }
                }
                //针对宏来自sql查询列表控件 isMustValue在选择时 值为“_请选择” 所以需要特殊处理下必填条件下 isMustValue的值
                else if(datatype == "macros"&&obj.attr('datafld') == 'SYS_LIST_SQL'){
                    if(isMustValue == '_请选择'){
                        isMustValue = '';
                    }
                }
                if(isCheck && ismust == 'true' && isMustValue == ""){          //适用于设置了当前流程必填字段和当前流程转出条件的流程
                    if(gobackIndex != 1){                      //适用于设置了当前流程必填字段和当前流程转出条件的流程，点击回退按钮兼容效果
                        flag = true;
                        layer.msg('<fmt:message code="main.th.PleaseFill" />'+obj.attr('title'), {icon: 1});
                        break;
                    }
                }
                if(value == null){
                    value = '';
                }
                baseData["key"]=key;
                baseData["value"]=value;
                baseDataTwo["key"]=key;
                baseDataTwo["value"]=datatype == 'sign' ? isMustValue : value;
                realData.push(baseData);
                realDataTwo.push(baseDataTwo);
                arr.push(key);
                if(thisprcsItem.indexOf(title) > -1||thisprcsItemAuto.indexOf(title) > -1){
                    modifydata.push(baseData);
                }
                if((deleteITEMcountersignature_item&&datatype == "fileupload")||(deleteITEMcountersignature_item&&datatype == "imgupload")){
                    modifydata.push(baseData);
                }
                modifydataObject[key] = value;
            }
            realData.push({
                'key':"DATA_0",
                'value':"完整表单"
            });
            modifydata.push({
                'key':"DATA_0",
                'value':document.getElementById("a2").outerHTML
                    // $('table').html()
            });
            gobackIndex = 0;                                     //当前流程,将判断回退按钮点击得索引，回复到0
            var nary = arr.sort();
            var cf = [];
            for(var i = 0; i < nary.length - 1; i++){
                if (nary[i] == nary[i+1]) {
                    cf.push(nary[i]);
                }
            }
            if(globalData.autoEdit == 0){
                var thisrunName= flowfun.runName;
            }else if(globalData.autoEdit == 1){
                var thisrunName= $('.runname').val();
            }
            /***************特殊的文号表达式功能start************************/
            if(thisrunName!=''&&thisrunName.indexOf('{FS') > -1&&thisrunName.indexOf('FE}|[') > -1){
                var arr = thisrunName.match(/\{FS[^\]]+\]/g);
                var sta = thisrunName.split(arr[0])[0];
                var end = thisrunName.split(arr[arr.length-1])[1];
                var str = '';
                for(var i=0;i<arr.length;i++){
                    if(arr[i].indexOf('['+ prcsId +']') > -1){
                        var title = arr[i].split('|[')[0].replace(/\{FS/g,'').replace(/\FE}/g,'');
                        if(modifydataObject[fromDataReject[title]]){
                            str += modifydataObject[fromDataReject[title]];
                        }
                    }else{
                        str += arr[i];
                    }
                }
                thisrunName = sta+str+end;
            }
            if(globalData.autoEdit == 0){
                $('.num').html('NO.'+ flowfun.runId +' '+thisrunName).attr('thisrunName',thisrunName);
            }else if(globalData.autoEdit == 1){
                $('.runname').val(thisrunName);
            }
            /***************特殊的文号表达式功能end************************/
            //判断表单是否存在控件id值为空或者为undefined
            if(!form_data){
                //判断表单中name是否有重复
                if(cf.length ==0){
                    if(!flag){
                        //shuju
                        var sysIds = {}
                        $('.autocode').each(function(){
                            var key = $(this).attr('id');
                            var value = $(this).attr('uuid') || $(this).attr('datafld');
                            sysIds[key] = value;
                        });

                        var fdata={
                            flowId:flowfun.flowId,
                            formdata:JSON.stringify(realData),
                            runId:flowfun.runId,
                            runName:thisrunName,
                            beginTime:flowfun.beginTime,
                            beginUser:flowfun.beginUser,
                            formLength:globalData.option.formLength,
                            prcsId : flowStep,
                            flowPrcs : prcsId,
                            modifydata:JSON.stringify(modifydata),
                            fromDataReject:JSON.stringify(fromDataReject),
                            tableName:tableName,
                            tabId:tabId,
                            workLevel:$('#level option:selected').val(),
                            countersignData:countersignData,
                            sysIds: JSON.stringify(sysIds)
                        };
                        var list = Signature.list;
                        var signatureCreator = Signature.create();
                        var kgsignList=$('.cont_form .kgsign');
                        kgsignList.each(function(){
                            var value = $(this).attr('value');
                            //新增签章
                            var key = ($(this).attr('signatureid') || '').split(',');
                            key.forEach(function (v,i) {
                                if(list[v]){
                                    signatureCreator.saveSignature(flowfun.runId, v, list[v].getSignatureData());
                                }
                            })
                        });
                        var indexzhuanjiao = layer.load(1);
                        $.ajax({
                            type: "post",
                            url: "../../workflow/work/nextwork",
                            dataType: 'JSON',
                            data: fdata,
                            success: function(res){
                                $('textarea[data-type=sign]').val('');
                                var data ={};
                                if(cb){
                                    if(res.flag){
                                        data['flag'] = true;
                                    }else{
                                        data['flag'] = false;
                                    }
                                    fdata.formdata = JSON.stringify(realDataTwo);
                                    data.data = res.obj;
                                    data.opt = fdata;
                                    layer.close(indexzhuanjiao)
                                    cb(data)
                                }
                            }
                        });
                    }
                }else{
                    var arr2 = [];
                    for(var i=0;i<cf.length;i++){
                        var xz = $('[name='+cf[i]+']');
                        var arr1 = [];
                        for(var j=0;j<xz.length;j++){
                            if(xz.eq(j).attr('title') != undefined){
                                arr1.push(xz.eq(j).attr('title'));
                            }
                        }
                        arr2.push(arr1);
                    }
                    var syrs = '保存失败，存在重复字段：';
                    for(var z=0;z<arr2.length;z++){
                        for(var h = 0;h<arr2[z].length;h++){
                            var q = h+1;
                            if(q != arr2[z].length){
                                syrs += arr2[z][h]+'与'
                            }else{
                                syrs += arr2[z][h]+'；'
                            }
                        }
                    }
                    layer.msg(syrs, {icon: 2});
                }
            }else{
                layer.msg('存在异常字段：'+form_title+'请通知系统管理员前往表单设计器调整表单！', {icon: 2});
            }
            if($("#zw").contents().find(".oper1001").length == 1){

                $(window.parent.document).contents().find("#zw")[0].contentWindow.parentZhuanjiaoBtn();
            }
        };
        function buildFormData(){
            var arr = {};
            $(".cont_form").find('.form_item').each(function(i,v){
                var _this = $(this);
                arr[_this.attr('title')] = _this.attr('name');
            });
            return arr;
        };
        function checkttachPriv(privNum){
            if(attachPriv.indexOf(privNum) > -1){
                return true;
            }
            return false   ;
        };
        function checkFeeback(){
            if(feedback != '1' ){
                return true;
            }
            return false;
        };
        function initUpload(runId) {
            $.ajax({
                type: "get",
                url: "findworkUpload",
                dataType: 'JSON',
                data: {
                    runId:runId
                },
                success: function (obj) {
                    $('#flowFilesTBody').html('')
                    if(obj.flag){
                        var str = '';
                        var fileStr = '';
                        obj.obj.forEach(function (v,i) {
                            var priv = v.aTTACH_PRIV;
                            var attachName = v.attachName;
                            var fileExtension=attachName.substring(attachName.lastIndexOf(".")+1,attachName.length);//截取附件文件后缀
                            var imgurl = iconImgType[fileExtension.toLowerCase()] || '/img/workflow/work/zip.png';
                            var str2 = '';
                            var style = 'margin-left: 0px;';
                            var downbtn = '';
                            var editbtn = '';
                            var deletebtn = '';
                            var attName = encodeURI(attachName).replace(/\+/g, "%2b").replace(/\@/g,"%40").replace(/\#/g,"%23").replace(/\&/g,"%26").replace(/\//g,"%2F").replace(/\?/g,"%3F").replace(/\￥/g,"%ef%bf%a5").replace(/\$/g,"%24").replace(/\！/g,"%ef%bc%81").replace(/\（/g,"%ef%bc%88").replace(/\）/g,"%ef%bc%89").replace(/\…/g,"%e2%80%a6%e2%80%a6");
                            var fileExtensionName=attName.substring(0,attName.lastIndexOf("."));
                            var attachmentUrl = v.attUrl;
                            attachmentUrl = attachmentUrl.substring(0,attachmentUrl.lastIndexOf("ATTACHMENT_NAME="))+"ATTACHMENT_NAME="+fileExtensionName+"."+fileExtension; //处理附件名字
                            if(checkttachPriv(2)){
                                editbtn = 'display: block;';
                            }else{
                                editbtn = 'display: none;';
                            }
                            if(fileExtension == 'doc' || fileExtension == 'DOC'|| fileExtension == 'docx' || fileExtension == 'DOCX'|| fileExtension == 'xls' || fileExtension == 'XLS'|| fileExtension == 'xlsx' || fileExtension == 'XLSX'|| fileExtension == 'ppt' || fileExtension == 'PPT'|| fileExtension == 'pptx'|| fileExtension == 'PPTX'){
                                str2 = '<h2 attUrl="'+attachmentUrl+'" class="editBtn item_wordH2" style="'+ editbtn +'"><fmt:message code="global.lang.edit" /></h2> ';
                            }
                            str += '<li><div class="item_logo"><img src="'+imgurl+'"></div>' +
                                '<div class="item_word" style="margin-top: 8px;letter-spacing: 1px;"><h1 class="item_wordH1" style="font-size: 11pt;" title="'+v.attachName+'">'+v.attachName+'</h1><h2></h2></div>' +
                                '<div class="item_word" style="margin-top: 2px;font-size: 9pt;">'+function(){
                                    if(checkttachPriv(4)){
                                        downbtn = 'display: block;';
                                    }else{
                                        downbtn = 'display: none;';
                                    }
                                    if(checkttachPriv(3)){
                                        deletebtn = 'display: block;';
                                    }else{
                                        deletebtn = 'display: none;';
                                    }
                                    if($.UrlGetRequest('?'+v.attUrl) != 'exe' && $.UrlGetRequest('?'+v.attUrl) != 'rar' && $.UrlGetRequest('?'+v.attUrl) != 'zip'&& $.UrlGetRequest('?'+v.attUrl) != 'key'&& $.UrlGetRequest('?'+v.attUrl) != 'numbers'&& $.UrlGetRequest('?'+v.attUrl) != 'pages'){
                                        style = 'margin-left: 10px;';
                                        if(fileExtension == 'pdf' || fileExtension == 'PDF'|| fileExtension == 'png' || fileExtension == 'PNG' || fileExtension == 'jpg' || fileExtension == 'JPG'|| fileExtension == 'txt'|| fileExtension == 'TXT') { //判断是否需要查阅
                                            return '<h1 class="previewBtn item_wordH2" style="margin-left: 0;" attUrl="'+encodeURI(attachmentUrl)+'">查阅</h1>';
                                        }else{
                                            return '<h1 class="previewBtn item_wordH2" style="margin-left: 0;" attUrl="'+attachmentUrl+'">查阅</h1>';
                                        }
                                    }else{
                                        return '';
                                    }
                                }()+ '<h1 class="downloadBtn item_wordH2" attUrl="'+encodeURI(attachmentUrl)+'" style="'+ style + downbtn + '"><fmt:message code="file.th.download" /></h1>'+
                                str2+
                                '<h1 class="deletefileBtn item_wordH2" attUrl="'+encodeURI(attachmentUrl)+'" style="'+ deletebtn +'"><fmt:message code="global.lang.delete" /></h1>'+
                                '</div></li>';

                            fileStr += '<tr><td  align="left">' + v.attachName + ' ' +
                                function () {
                                    if (fileExtension == 'pdf' || fileExtension == 'PDF' || fileExtension == 'png' || fileExtension == 'PNG' || fileExtension == 'jpg' || fileExtension == 'JPG' || fileExtension == 'txt' || fileExtension == 'TXT') { //判断是否需要查阅
                                        return '<a style="color: #1687cb;" class="fileDownload yulan"  href="javascript:void(0);" data-url="' + encodeURI(attachmentUrl) + '" style="margin-left: 10px">查阅</a>'
                                    } else {
                                        return '<a style="color: #1687cb;" class="fileDownload chayue"  href="javascript:void(0);" data-url="' + attachmentUrl + '" style="margin-left: 10px">查阅</a>'
                                    }
                                }() + ' ' +
                                function () {
                                    if (priv != "" && priv.indexOf('4') >= 0) {
                                        return '<a style="color: #1687cb;" class="download" url="/download?' + encodeURI(attachmentUrl) + '" href="javascript:void(0);" onclick="clickDownload($(this));">下载</a>'
                                    } else {
                                        return ''
                                    }
                                }() +
                                '</td><td align="left">' + v.fileSize + '</td></tr>'

                        });
                        if( obj.obj.length>0){
                            $('#img_none').hide();
                            $('#flowFiles').show();
                            $('#flowFilesTBody').html(fileStr);
                        } else {
                            $('#flowFiles').hide();
                        }
                        if(obj.obj.length ==0){
                            $('#oneUploadFile').hide();
                        }else{
                            $('.fujian').append('<div class="he fujianhe">'+ obj.obj.length +'</div>');
                        }
                        $('#oneUploadFile').html(str);
                    } else {
                        $('#flowFiles').hide();
                    }
                }
            });
        };

        function initSlideBar(prcsId,flowPrcs,runId){
            initSign(prcsId,flowPrcs,runId);
            getSign(runId);
            initUpload(runId);
        };
        function checkPrcIn(prcsIn,prcsInSet,formdata,fromDataReject,cb){
            var res = {
                flag:true,
                msg:''
            };
            var arrtest = [];
            var prcsInArr = prcsIn.split('\n');

            for(var i=0;i<prcsInArr.length;i++){
                if(prcsInArr[i]){
                    arrtest.push(prcsInArr[i])
                }
            }
            if(arrtest.length == 1 && prcsInSet == ''){
                prcsInSet='[1]';
            }
            if(prcsInSet != ""){

                formdata = covertToFormData(formdata);

                prcsInArr.forEach(function(v,i){

                    if(v){

                        var check_pass = 0;
                        var titleValue = '';
                        if(v.indexOf("'") > -1){

                            var arr_rule = v.split("'");

                            var item_title = myTrim(arr_rule[1]);
                            var item_con = myTrim(arr_rule[2]);
                            var item_value = myTrim(arr_rule[3]);
                            var item_pag = $('[Id="'+fromDataReject[item_title]+'"]')
                            titleValue = formdata[fromDataReject[item_title]];

                            if(v.indexOf('[')<=-1){
                                if(item_pag.attr('data-type')=='macros'&&item_pag.attr('datafld')=='SYS_USERNAME'&&item_pag.attr('orgsignImg')==1){
                                    if(item_pag.prev().find('img').attr('src')!=undefined&&item_pag.prev().find('img').attr('src')!=''&&item_pag.prev().find('img').attr('src').indexOf('AID')>=0){
                                        titleValue = item_pag.prev().find('img').attr('src');
                                    }else{
                                        titleValue = formdata[fromDataReject[item_title]];
                                    }
                                }else if(fromDataReject[item_title]&&$('#'+ fromDataReject[item_title] +'').attr('data-type') == 'userselect'){
                                    var str = $('#'+ fromDataReject[item_title] +'').val();
                                    titleValue = str.substr(0,str.length-1);
                                }else{
                                    if(item_pag.attr('data-type') == 'sign'&&workForm.option.dataName){
                                        titleValue = workForm.option.dataName[fromDataReject[item_title]]+formdata[fromDataReject[item_title]];
                                    }else{
                                        titleValue = formdata[fromDataReject[item_title]];
                                    }
                                }

                                // if(fromDataReject[item_title]&&$('#'+ fromDataReject[item_title] +'').attr('data-type') == 'userselect'){
                                //     var str = $('#'+ fromDataReject[item_title] +'').val();
                                //     titleValue = str.substr(0,str.length-1);
                                // }else{
                                //     titleValue = formdata[fromDataReject[item_title]];
                                // }
                            }else{
                                if(item_title == '[当前步骤号]' || item_title == '[CUR_PRCS_ID]'){
                                    titleValue = globalData.flowRunPrcs.prcsId
                                }else if(item_title == '[当前主办人姓名]' || item_title == '[CUR_USER_NAME]'){
                                    titleValue = globalData.userName;
                                }else if(item_title == '[公共附件名称]' || item_title == '[ATTACH_NAME]'){
                                    titleValue = '';
                                    for(var j=0;j<$('#oneUploadFile .item_wordH1').length;j++){
                                        if($('#oneUploadFile .item_wordH1').length ==1){
                                            titleValue = GetFileNameNoExt($('#oneUploadFile .item_wordH1').eq(j).attr('title'))
                                        }else{
                                            titleValue += GetFileNameNoExt($('#oneUploadFile .item_wordH1').eq(j).attr('title')) + ','
                                        }
                                    }
                                }else if(item_title == '[公共附件个数]' || item_title == '[ATTACH_COUNT]'){
                                    titleValue = $('#oneUploadFile .item_wordH1').length;
                                }else if(item_title == '[当前流程设计步骤号]' || item_title == '[CUR_FLOW_PRCS]'){
                                    titleValue = globalData.flowRunPrcs.flowPrcs
                                }else if(item_title == '[当前主办人角色]' || item_title == '[CUR_USER_PRIV]'){
                                    titleValue = workForm.tool.MacrosData.data.sYS_USERPRIV;
                                }else if(item_title == '[当前主办人角色_辅助角色]' || item_title == '[CUR_USER_PRIV_OTHER]'){
                                    var thisd = workForm.tool.MacrosData.data.sYS_USERPRIVOTHER;
                                    if(thisd.substr(thisd.length-1,thisd.length) == ','){
                                        thisd = thisd.substr(0,thisd.length-1);
                                    }
                                    titleValue = thisd;
                                }else if(item_title == '[当前主办人部门]' || item_title == '[CUR_USER_DEPT]'){
                                    titleValue = workForm.tool.getMacrosData('SYS_DEPTNAME_SHORT')()
                                }else if(item_title == '[当前主办人上级部门]' || item_title == '[CUR_USER_DEPT_PARENT]'){
                                    titleValue = workForm.tool.getMacrosData('SYS_MANAGER2')()
                                }else if(item_title == '[主办人会签意见]' || item_title == '[MAIN_USER_SIGN]'){
                                    var data = globalData.sign;
                                    titleValue=""
                                    for(var j=0;j<data.length;j++){
                                        if(data[j].opFlag == 1){
                                            titleValue += data[j].content
                                        }
                                    }
                                }else if(item_title == '[经办人会签意见]' || item_title == '[USER_SIGN]'){
                                    var data = globalData.sign;
                                    titleValue=""
                                    for(var j=0;j<data.length;j++){
                                        if(data[j].opFlag == 0){
                                            titleValue += data[j].content
                                        }
                                    }
                                }
                            }

                            //                           判断 第二个值是字段还是类型
                            if(fromDataReject[item_value]){//如果是字段并且是表单中字段的话
                                item_value = formdata[fromDataReject[item_value]];
                            }else{
                                if(item_value.indexOf('[')>-1){ //如果是字段并且不是表单中字段
                                    if(item_value == '[当前步骤号]' || item_value == '[CUR_PRCS_ID]'){
                                        item_value = globalData.flowRunPrcs.prcsId
                                    }else if(item_value == '[当前主办人姓名]' || item_value == '[CUR_USER_NAME]'){
                                        item_value = globalData.userName;
                                    }else if(item_title == '[公共附件名称]' || item_title == '[ATTACH_NAME]'){
                                        item_value = item_value;
                                    }else if(item_title == '[公共附件个数]' || item_title == '[ATTACH_COUNT]'){
                                        item_value = item_value;
                                    }else if(item_value == '[当前流程设计步骤号]' || item_value == '[CUR_FLOW_PRCS]'){
                                        item_value = globalData.flowRunPrcs.flowPrcs
                                    }else if(item_value == '[当前主办人角色]' || item_value == '[CUR_USER_PRIV]'){
                                        item_value = workForm.tool.MacrosData.data.sYS_USERPRIV;
                                    }else if(item_title == '[当前主办人角色_辅助角色]' || item_title == '[CUR_USER_PRIV_OTHER]'){
                                        var thisd = workForm.tool.MacrosData.data.sYS_USERPRIVOTHER;
                                        if(thisd.substr(thisd.length-1,thisd.length) == ','){
                                            thisd = thisd.substr(0,thisd.length-1);
                                        }
                                        item_value = thisd;
                                    } else if(item_value == '[当前主办人部门]' || item_value == '[CUR_USER_DEPT]'){
                                        item_value = workForm.tool.getMacrosData('SYS_DEPTNAME_SHORT')()
                                    }else if(item_value == '[当前主办人上级部门]' || item_value == '[CUR_USER_DEPT_PARENT]'){
                                        item_value = workForm.tool.getMacrosData('SYS_MANAGER2')()
                                    }else if(item_value == '[主办人会签意见]' || item_value == '[MAIN_USER_SIGN]'){
                                        var data = globalData.sign;
                                        item_value=""
                                        if(data!=''&&data!=undefined){
                                            for(var j=0;j<data.length;j++){
                                                if(data[j].opFlag == 1){
                                                    item_value += data[j].content
                                                }
                                            }
                                        }

                                    }else if(item_value == '[经办人会签意见]' || item_value == '[USER_SIGN]'){
                                        var data = globalData.sign;
                                        item_value=""
                                        if(data!=''&&data!=undefined){
                                            for(var j=0;j<data.length;j++){
                                                if(data[j].opFlag == 0){
                                                    item_value += data[j].content
                                                }
                                            }
                                        }

                                    }
                                }else{ //如果是类型值的话
                                    if(item_value == '数值'){
                                        item_value = 'shu'
                                    }else if(item_value == '日期'){
                                        item_value = 'date'
                                    }else if(item_value == '时间+日期'){
                                        item_value = 'time';
                                    }else{
                                        item_value = item_value;
                                    }
                                }
                            }
                            if(titleValue == undefined){
                                res.msg = '条件设置有误，不存在“'+item_title+'”字段，请联系系统管理员前往流程设计器修改！';
                            }else{
                                check_pass = checkTileValue(titleValue,item_con,item_value);

                            }
                            check_pass = checkTileValue(titleValue,item_con,item_value);
                            var setitem =  (i+1)
                            var reg = new RegExp('\\['+setitem+'\\]',"g");//g,表示全部替换。

                            prcsInSet = prcsInSet.replace(reg,check_pass);
                        }


                    }
                });
                prcsInSet = covertToPrcsOutSet(prcsInSet.toLowerCase());
                // 替换字符串中的中文括号为英文括号
                if(prcsInSet.indexOf('（') > -1 ||prcsInSet.indexOf('）') > -1){
                    prcsInSet = prcsInSet.replace(/\（/g, "(").replace(/\）/g, ")");
                }

                // 判断所包含的所有括号是否成对
                // 前括号出现次数
                var prevTimes = getShowTimes(prcsInSet,'(');
                // 后括号出现次数
                var lastTimes = getShowTimes(prcsInSet,')');
                // 前括号比后括号少
                if (prevTimes < lastTimes) {
                    var times = lastTimes - prevTimes;
                    for (var i = 0; i < times; i++) {
                        prcsInSet = '(' + prcsInSet;
                    }
                }
                // 后括号比前括号少
                if (prevTimes > lastTimes) {
                    var times = prevTimes - lastTimes;
                    for (var i = 0; i < times; i++) {
                        prcsInSet = prcsInSet + ')';
                    }
                }
                console.log(prcsInSet);
                var result = 0;
                try {
                    result = eval(prcsInSet);
                } catch (e) {
                    console.log(e);
                }

                if(result == 0){
                    res.flag = false;
                }
            }
            if(cb){
                cb(res);
            }
        };
        function covertToFormData(formdata){
            var data = {};
            if(formdata instanceof Array){
                formdata.forEach(function(v,i){
                    data[v.key] =  v.value;
                });
            }
            return data;
        };
        function covertToPrcsOutSet(data){
            data = data.replace(/or/g,'||')
            data = data.replace(/and/g,'&&')
            return data;
        };
        function checkPrcOut(formdata,fromDataReject,cb){
            var msg = globalData.conditionDesc.split('\n')[1];
            var res = {
                flag:true,
                msg:""
            };
            if(msg){
                res.msg = msg;
            }else{
                res.msg =  '<fmt:message code="main.th.NonConformity" />'
            }
            var prcsOut = globalData.prcsOut;
            var prcsOutSet = globalData.prcsOutSet;
            var prcsOutArr = prcsOut.split('\n');
            if(prcsOutArr.length == 1 && prcsOutSet==''){
                prcsOutSet = '[1]'
            }
            if(prcsOutSet != ""){

                formdata = covertToFormData(formdata);


                prcsOutArr.forEach(function(v,i){
                    if(v){
                        if(v.indexOf('"')>=0){
                            v = v.replace(/"/g,"'");
                        }
                        var check_pass = 0;
                        var titleValue = '';
                        var arr_rule = v.split("'");
                        var item_title = myTrim(arr_rule[1]);
                        var item_con = myTrim(arr_rule[2]);
                        var item_value = myTrim(arr_rule[3]);
                        //用来处理 特殊情况单选框控件，无法通过id来选择到元素的情况
                        var item_pag = $('[Id="'+fromDataReject[item_title]+'"]');
                        if(item_pag.length == 0&&$('[name='+ fromDataReject[item_title] +']').eq(0).attr('data-type') == 'radio'){
                            item_pag = $('input[name='+ fromDataReject[item_title] +']:checked');
                        }
                        if(v.indexOf('[')<=-1){
                            if(item_pag.attr('data-type')=='macros'&&item_pag.attr('datafld')=='SYS_USERNAME'&&item_pag.attr('orgsignImg')==1){
                                if(item_pag.prev().find('img').attr('src')!=undefined&&item_pag.prev().find('img').attr('src')!=''&&item_pag.prev().find('img').attr('src').indexOf('AID')>=0){
                                    titleValue = item_pag.prev().find('img').attr('src');
                                }else{
                                    titleValue = formdata[fromDataReject[item_title]];
                                }
                            }else{
                                titleValue = formdata[fromDataReject[item_title]];
                                //该判断为会签控件时，需做特殊判断处理
                                if(item_pag.attr('data-type') == 'sign'&& workForm.option.dataName){
                                    titleValue = workForm.option.dataName[fromDataReject[item_title]]+formdata[fromDataReject[item_title]];
                                }
                                //该判断为下拉菜单为下拉子菜单时，需做特殊判断处理
                                if(titleValue&&titleValue.indexOf('|') > -1&&item_pag.attr('data-type') == 'select'){
                                    titleValue = titleValue.split('|')[0];
                                }
                                //该判断为宏部门列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_DEPT'){
                                    if(titleValue&&titleValue.indexOf('├') > -1 || titleValue&&titleValue.indexOf('┌') > -1){
                                        titleValue=item_pag.find('option:checked').attr('deptname')
                                    }
                                }
                                //该判断为部门人员（本部门）列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_DEPT_PERSON'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏人员列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_USER'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏角色列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_PRIV_ONLY'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏辅助角色列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_PRIV_OTHER'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏流程设置所有经办人列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_PRCSUSER1'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏本步骤设置经办人列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_PRCSUSER2'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏部门主管（本部门）列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_MANAGER1'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏部门主管（上级部门）列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_MANAGER2'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏部门主管（一级部门）列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_MANAGER3'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为宏来自sql查询列表控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'macros'&&item_pag.attr('datafld') == 'SYS_LIST_SQL'){
                                    if(titleValue&&titleValue.indexOf('_') > -1){
                                        titleValue = titleValue.split('_')[1];
                                    }
                                }
                                //该判断为部门选择控件 和 用户选择控件时，需对titleValue处理
                                else if(item_pag.attr('data-type') == 'deptselect' || item_pag.attr('data-type') == 'userselect'){
                                    if(titleValue&&titleValue.indexOf('|')>-1){
                                        titleValue = titleValue.split('|')[1];
                                        if(titleValue.substring(titleValue.length-1,titleValue.length) == ','){
                                            titleValue = titleValue.substring(0,titleValue.length-1);
                                        }
                                    }
                                }

                            }

                        }else{
                            if(item_title == '[当前步骤号]' || item_title == '[CUR_PRCS_ID]'){
                                titleValue = globalData.flowRunPrcs.prcsId
                            }else if(item_title == '[当前主办人姓名]' || item_title == '[CUR_USER_NAME]'){
                                titleValue = globalData.userName;
                            }else if(item_title == '[公共附件名称]' || item_title == '[ATTACH_NAME]'){
                                titleValue = '';
                                for(var j=0;j<$('#oneUploadFile .item_wordH1').length;j++){
                                    if($('#oneUploadFile .item_wordH1').length ==1){
                                        titleValue = GetFileNameNoExt($('#oneUploadFile .item_wordH1').eq(j).attr('title'))
                                    }else{
                                        titleValue += GetFileNameNoExt($('#oneUploadFile .item_wordH1').eq(j).attr('title')) + ','
                                    }
                                }
                            }else if(item_title == '[公共附件个数]' || item_title == '[ATTACH_COUNT]'){
                                titleValue = $('#oneUploadFile .item_wordH1').length;
                            }else if(item_title == '[当前流程设计步骤号]' || item_title == '[CUR_FLOW_PRCS]'){
                                titleValue = globalData.flowRunPrcs.flowPrcs
                            }else if(item_title == '[当前主办人角色]' || item_title == '[CUR_USER_PRIV]'){
                                titleValue = workForm.tool.MacrosData.data.sYS_USERPRIV;
                            }else if(item_title == '[当前主办人角色_辅助角色]' || item_title == '[CUR_USER_PRIV_OTHER]'){
                                var thisd = workForm.tool.MacrosData.data.sYS_USERPRIVOTHER;
                                if(thisd.substr(thisd.length-1,thisd.length) == ','){
                                    thisd = thisd.substr(0,thisd.length-1);
                                }
                                titleValue = thisd;
                            }else if(item_title == '[当前主办人部门]' || item_title == '[CUR_USER_DEPT]'){
                                titleValue = workForm.tool.getMacrosData('SYS_DEPTNAME_SHORT')()
                            }else if(item_title == '[当前主办人上级部门]' || item_title == '[CUR_USER_DEPT_PARENT]'){
                                titleValue = workForm.tool.getMacrosData('SYS_MANAGER2')()
                            }else if(item_title == '[主办人会签意见]' ||　item_title == '[MAIN_USER_SIGN]'){
                                var data = globalData.sign;
                                titleValue=""
                                if(data!=''&&data!=undefined){
                                    for(var j=0;j<data.length;j++){
                                        if(data[j].opFlag == 1){
                                            titleValue += data[j].content
                                        }
                                    }
                                }
                            }else if(item_title == '[经办人会签意见]' || item_title == '[USER_SIGN]'){
                                var data = globalData.sign;
                                titleValue=""
                                if(data!=''&&data!=undefined){
                                    for(var j=0;j<data.length;j++){
                                        if(data[j].opFlag == 0){
                                            titleValue += data[j].content
                                        }
                                    }
                                }

                            }
                        }
//                           判断 第二个值是字段还是类型
                        if(fromDataReject[item_value]){//如果是字段并且是表单中字段的话
                            item_value = formdata[fromDataReject[item_value]];
                        }else{
                            if(item_value.indexOf('[')>-1){ //如果是字段并且不是表单中字段
                                if(item_value == '[当前步骤号]' || item_value == '[CUR_PRCS_ID]'){
                                    item_value = globalData.flowRunPrcs.prcsId
                                }else if(item_value == '[当前主办人姓名]' ||item_value == '[CUR_USER_NAME]'){
                                    item_value = globalData.userName;
                                }else if(item_title == '[公共附件名称]'　|| item_title == '[ATTACH_NAME]'){
                                    item_value = item_value;
                                }else if(item_title == '[公共附件个数]' || item_title == '[ATTACH_COUNT]'){
                                    item_value = item_value;
                                }else if(item_value == '[当前流程设计步骤号]' || item_value == '[CUR_FLOW_PRCS]'){
                                    item_value = globalData.flowRunPrcs.flowPrcs
                                }else if(item_value == '[当前主办人角色]' || item_value == '[CUR_USER_PRIV]'){
                                    item_value = workForm.tool.MacrosData.data.sYS_USERPRIV;
                                }else if(item_title == '[当前主办人角色_辅助角色]' || item_title == '[CUR_USER_PRIV_OTHER]'){
                                    var thisd = workForm.tool.MacrosData.data.sYS_USERPRIVOTHER;
                                    if(thisd.substr(thisd.length-1,thisd.length) == ','){
                                        thisd = thisd.substr(0,thisd.length-1);
                                    }
                                    item_value = thisd;
                                }else if(item_value == '[当前主办人部门]' || item_value == '[CUR_USER_DEPT]'){
                                    item_value = workForm.tool.getMacrosData('SYS_DEPTNAME_SHORT')()
                                }else if(item_value == '[当前主办人上级部门]' ||item_value == '[CUR_USER_DEPT_PARENT]'){
                                    item_value = workForm.tool.getMacrosData('SYS_MANAGER2')()
                                }else if(item_value == '[主办人会签意见]'　|| item_value == '[MAIN_USER_SIGN]'){
                                    var data = globalData.sign;
                                    item_value=""
                                    for(var j=0;j<data.length;j++){
                                        if(data[j].opFlag == 1){
                                            item_value += data[j].content
                                        }
                                    }
                                }else if(item_value == '[经办人会签意见]' ||item_value == '[USER_SIGN]'){
                                    var data = globalData.sign;
                                    item_value=""
                                    for(var j=0;j<data.length;j++){
                                        if(data[j].opFlag == 0){
                                            item_value += data[j].content
                                        }
                                    }
                                }
                            }else{ //如果是类型值的话
                                if(item_value == '数值'){
                                    item_value = 'shu'
                                }else if(item_value == '日期'){
                                    item_value = 'date'
                                }else if(item_value == '时间+日期'){
                                    item_value = 'time';
                                }else{
                                    item_value = item_value;
                                }
                            }
                        }
                        if(titleValue == undefined){
                            res.msg = '条件设置有误，不存在“'+item_title+'”字段，请联系系统管理员前往流程设计器修改！';
                        }else{
                            //该判断为部门选择控件 且 条件为等于 时，调用judgeResult()方法来判断用户选择框和条件设置框字段是否相同（不论排序）
                            if(item_pag.attr('data-type') == 'deptselect'&&item_con=='='  ||  item_pag.attr('data-type') == 'userselect'&&item_con=='=' ){
                                check_pass=judgeResult(titleValue,item_value)
                            }
                            //该判断为部门选择控件 且 条件为不等于 时，调用judgeResult()方法来判断用户选择框和条件设置框字段是否相同（不论排序）
                            else if(item_pag.attr('data-type') == 'deptselect'&&item_con=='!=' || item_pag.attr('data-type') == 'userselect'&&item_con=='!='){
                                check_pass=!judgeResult(titleValue,item_value)
                            }
                            else{
                                check_pass = checkTileValue(titleValue,item_con,item_value);
                            }
                        }
                        var setitem = (i+1)
                        var reg = new RegExp('\\['+setitem+'\\]',"g");//g,表示全部替换。

                        prcsOutSet = prcsOutSet.replace(reg,check_pass);
                    }
                });
                prcsOutSet = covertToPrcsOutSet(prcsOutSet.toLowerCase());
                if(prcsOutSet.indexOf('（') > -1 ||prcsOutSet.indexOf('）') > -1){
                    prcsOutSet = prcsOutSet.replace(/\（/g, "(").replace(/\）/g, ")");
                }
                var result = eval(prcsOutSet);
                if(result == 0){
                    res.flag = false;
                }
            }
            if(cb){
                cb(res);
            }
        };
        //判断部门选择控件 和 用户选择控件 中用户选择字段和条件设置字段是否相同
        function judgeResult(titleValue,item_value) {
            var flag = 1
            if(titleValue!==undefined && item_value!==undefined){
                titleValue=titleValue.split(',')
                item_value=item_value.split(',')
            }
            if (titleValue.length !== item_value.length) {
                flag = 0
            } else {
                titleValue.forEach(function (item) {
                    if (item_value.indexOf(item) === -1) {
                        flag = 0
                    }
                })
            }
            return flag;
        }
        function checkTileValue(item_value,rule,item_title){
            var checkpass = 0;
            if(item_value != ''){
                if(typeof item_value == 'string'){
                    if(item_value.indexOf('-')>-1||item_value.indexOf(':')>-1||item_value.indexOf(',')>-1||item_value.indexOf('|')>-1){
                        var item_value =  item_value
                    }else{
                        var item_value = parseFloat(item_value)  || item_value ;
                    }
                }else{
                    var item_value = parseFloat(item_value)  || item_value ;
                }


            }else{
                var item_value =  item_value;
            }
            if(item_title != ''){
                if(typeof item_title =='string'){
                    if(item_title.indexOf('-')>-1||item_title.indexOf(':')>-1){
                        var item_title = item_title
                    }else{
                        var item_title =  parseFloat(item_title) || item_title ;
                    }
                }else{
                    var item_title =  parseFloat(item_title) || item_title ;
                }

            }else{
                var item_title =  item_title;
            }
            var date = /^(\d{4})-(0\d{1}|1[0-2])-(0\d{1}|[12]\d{1}|3[01])$/;
            var time = /^(((?!0000)[0-9]{4}-((0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-8])|(0[13-9]|1[0-2])-(29|30)|(0[13578]|1[02])-31)|([0-9]{2}(0[48]|[2468][048]|[13579][26])|(0[48]|[2468][048]|[13579][26])00)-02-29)) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$/


            switch (rule) {
                case '=':
                    var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/;
                    if(item_title == 'shu'&&!isNaN(item_value)){
                        checkpass = 1;
                    }else if(item_title == 'date'&& /^(\d{4})-(0\d{1}|1[0-2])-(0\d{1}|[12]\d{1}|3[01])$/.test(item_value)){
                        checkpass = 1;
                    }else if(item_title == 'time'&& !reDateTime.test(item_value)){
                        checkpass = 1;
                    }else if (item_title == item_value) {
                        checkpass = 1;
                    }
                    break;
                case '!=':
                    var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/;
                    if(item_title == 'shu'&&isNaN(item_value)){
                        checkpass = 1;
                    }else if(item_title == 'date'&& !/^(\d{4})-(0\d{1}|1[0-2])-(0\d{1}|[12]\d{1}|3[01])$/.test(item_value)){
                        checkpass = 1;
                    }else if(item_title == 'time'&& reDateTime.test(item_value)){
                        checkpass = 1;
                    }else if (item_title != item_value) {
                        checkpass = 1;
                    }
                    break;
                case '<>':
                    if(date.test(item_title) && date.test(item_value)){
                        if(new Date(item_title.replace(/-/g, "/")).getTime()!=new Date(item_value.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if(time.test(item_title) && time.test(item_value)){
                        if(new Date(item_title.replace(/-/g, "/")).getTime()!=new Date(item_value.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if (item_title != item_value) {
                        checkpass = 1;
                    }
                    break;
                case '>':
                    if(date.test(item_title) && date.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()>new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if(time.test(item_title) && time.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()>new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if ( item_value >  item_title) {
                        checkpass = 1;
                    }
                    break;
                case '<':
                    if(date.test(item_title) && date.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()<new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if(time.test(item_title) && time.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()<new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if (item_value < item_title) {
                        checkpass = 1;
                    }
                    break;
                case '<=':
                    if(date.test(item_title) && date.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()<=new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if(time.test(item_title) && time.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()<=new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if (item_value <=  item_title) {
                        checkpass = 1;
                    }
                    break;
                case '>=':
                    if(date.test(item_title) && date.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()>=new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if(time.test(item_title) && time.test(item_value)){
                        if(new Date(item_value.replace(/-/g, "/")).getTime()>=new Date(item_title.replace(/-/g, "/")).getTime()){
                            checkpass = 1;
                        }
                    }else if (item_value >=  item_title) {
                        checkpass = 1;
                    }
                    break;
                case 'include':
                    if(item_value==''){
                        if(item_title==''){
                            checkpass = 1;
                        }
                    }else{
                        item_value = String(item_value);
                        if (item_value.indexOf(item_title) > -1) {
                            checkpass = 1;
                        }
                    }
                    break;
                case 'exclude':
                    if(item_value==''){
                        if(item_title==''){
                            checkpass = 1;
                        }
                    }else{
                        item_value = String(item_value);
                        if(item_value!=''){
                            if (item_value.indexOf(item_title) == -1) {
                                checkpass = 1;
                            }
                        }
                    }
                    break;
            }
            return checkpass;
        };
        function myTrim(x) {
            if(x!=undefined){
                return x.replace(/^\s+|\s+$/gm,'');
            }
        };
        function getSign(runId){
            $.ajax({
                type:'get',
                url:'/flowProcess/getFlowRunPrecsOpFlag',
                data:{
                    runId:runId
                },
                success:function(res){
                    var data = res.object;
                    if(data.length>0){
                        globalData.sign= data;
                    }else{
                        globalData.sign= '';
                    }
                }
            })
        };
        function initSign(prcsId,flowPrcs,runId){
            $.ajax({
                type: "post",
                url: "findworkfeedback",
                dataType: 'JSON',
                data: {
                    prcsId:flowPrcs,
                    signlock:signlock,
                    flowPrcs:prcsId,
                    runId:runId
                },
                success: function (obj) {
                    var user = $.cookie('userId')
                    if(obj.flag){
                        if(obj.obj.length!=0){
                            globalData.data = obj.obj;

                            var str = '';
                            obj.obj.forEach(function (v,i) {
                                var prcsflow = v.flowPrcs;
                                var avatar = v.users.avatar;
//                                    console.log(v.flowPrcs)
								if(v.feedFlag == 2){
									var feedFlagstr = '<h1 style="font-weight: 600;color: red;">回退意见：</h1>';
								}else{
									var feedFlagstr = '';
								}
                                if (avatar==0){
                                    str += '<li id="'+v.feedId+'" flowNum="'+prcsflow+'" flowPrcs="'+v.flowPrcs+'" runId="'+v.runId+'"><div class="huiqian_touxiang"><img class="huiqian_logo" style="width: 40px;margin-top: 8px" src="../../img/user/boy.png"></div><div class="huiqian_word" style="width:175px;">'+feedFlagstr+'<h1 style="display: inline-block;font-weight: 600;">'+v.users.userName+'</h1><h1 style="display: inline-block;font-size: 12px;margin-left: 8px;color: #999;">'+v.users.userPrivName+'</h1><div class="cesdiv"  title="'+v.content+'">'+v.content+'</div><div class="area" style="display:none"><textarea name="" id="signText" style="width:80%;height:35px"></textarea></div><div class="h2s" style="font-size: 12px;margin-top: 1px;">'+v.editTime+function(){
                                        if(prcsId == prcsflow && user == v.userId){
                                            return '<span class="edit"><img src="/img/workflow/work/edit.png" alt=""></span><span class="del"><img src="/img/workflow/work/del.png" alt=""></span>'
                                        }else{
                                            return ''
                                        }
                                    }()+'</div></div></li>';
                                }else if(avatar==1){
                                    str += '<li id="'+v.feedId+'" flowNum="'+prcsflow+'" flowPrcs="'+v.flowPrcs+'" runId="'+v.runId+'"><div class="huiqian_touxiang"><img class="huiqian_logo" style="width: 40px;margin-top: 8px" src="../../img/user/girl.png"></div><div class="huiqian_word" style="width:175px;">'+feedFlagstr+'<h1 style="display: inline-block;font-weight: 600;">'+v.users.userName+'</h1><h1 style="display: inline-block;font-size: 12px;margin-left: 8px;color: #999;">'+v.users.userPrivName+'</h1><div class="cesdiv" title="'+v.content+'">'+v.content+'</div><div class="area" style="display:none" ><textarea name="" id="signText" style="width:80%;height:35px"></textarea></div><div class="h2s" style="font-size: 12px;margin-top: 1px;">'+v.editTime+function(){
                                        if(prcsId == prcsflow && user == v.userId){
                                            return '<span class="edit"><img src="/img/workflow/work/edit.png" alt=""></span><span class="del"><img src="/img/workflow/work/del.png" alt=""></span>'
                                        }else{
                                            return ''
                                        }
                                    }()+'</div></div></li>';
                                }else{
                                    str += '<li id="'+v.feedId+'" flowNum="'+prcsflow+'" flowPrcs="'+v.flowPrcs+'" runId="'+v.runId+'"><div class="huiqian_touxiang"><img class="huiqian_logo" style="width: 40px;margin-top: 8px" src="../../img/user/'+ avatar +'"></div><div class="huiqian_word" style="width:175px;">'+feedFlagstr+'<h1 style="display: inline-block;font-weight: 600;">'+v.users.userName+'</h1><h1 style="display: inline-block;font-size: 12px;margin-left: 8px;color: #999;">'+v.users.userPrivName+'</h1><div class="cesdiv"  title="'+v.content+'">'+v.content+'</div><div class="area" style="display:none"><textarea name="" id="signText" style="width:80%;height:35px"></textarea></div><div class="h2s" style="font-size: 12px;margin-top: 1px;">'+v.editTime+function(){
                                        if(prcsId == prcsflow && user == v.userId){
                                            return '<span class="edit"><img src="/img/workflow/work/edit.png" alt=""></span><span class="del"><img src="/img/workflow/work/del.png" alt=""></span>'
                                        }else{
                                            return ''
                                        }
                                    }()+'</div></div></li>';

                                }

                            });
                            $('#signbox').html(str)
                            $('.huiqian').append('<div class="he huiqianhe">'+ obj.obj.length +'</div>');

                        }else{

                            $('#signbox').html('')
                            globalData.data = "";
                            if (feedback == '1') {
                                $('#hui').hide()
                            }
                        }
                    }
                }
            });
        };
        function subPric(source,pos) {
            var strs= new Array(); //定义一数组
            strs=source.split(pos); //字符分割
            return strs;
        };
        function otherFlowRflect(tableName,tableId,runId){
            if(tableName && tableName!='' && tableId!='' && runId !=''){
                $.ajax({
                    type: "post",
                    url: "../../tigger/modifyFieldProperties",
                    dataType: 'JSON',
                    data: {
                        tableName:tableName,
                        id:tableId,
                        runId:runId
                    },
                    success: function(res){
                        //console.log(res);
                    }
                })
            }
        };
        function checkOptionButton() {
            $('.opt_btn').remove()
            $('#associationOperation ul').empty()
            if (globalData.flowProcesses && globalData.flowProcesses.operationButton) {
                var operationBtn = globalData.flowProcesses.operationButton.split(',');
                var flag = false;
                if (operationBtn.length > 0) {
                    $.ajax({
                        type: 'GET',
                        url: '/documentExchangeSet/selectByUser',
                        async: false,
                        success: function (res) {
                            if (res.flag) {
                                if (res.object == 1) {
                                    flag = true;
                                }
                            }
                        }
                    });
                    for (var i = operationBtn.length - 2; i >= 0; i--) {
                        if (operationBtn[i].length > 0 && operationBtn[i] != '') {
                            if (!flag) {
                                if (operationBtn[i] == 1 || operationBtn[i] == 2) {
                                    continue;
                                }
                            }

                            if (operationBtn[i] == 3 || operationBtn[i] == 12 || operationBtn[i] == 15) {
                                continue;
                            }

                            $.ajax({
                                type: 'GET',
                                url: '/operation/selFlowOperationById?opId=' + operationBtn[i],
                                async: false,
                                success: function (res) {
                                    if (res.flag) {
                                        // var optStr = '<li id="' + res.object.opId + '" class="rig_li opt_btn" style="width: auto;" data-type="' + res.object.opId + '"><img src="/img/workflow/flowsetting/'+res.object.picName+'.png" style="margin: -3px -5px 0 6px;"><h1 class="rig_h1" style="width: auto;float: right; padding: 0 10px;display:inline-block;">' + res.object.opName + '</h1></li>'
                                        if (res.object.opId == 8) {
                                            var optStr = '<li id="' + res.object.opId + '" class="rig_li opt_btn" style="width: auto;" data-type="' + res.object.opId + '"><img src="/img/workflow/flowsetting/' + res.object.picName + '.png" style="margin: -3px -5px 0 6px;"><h1 class="rig_h1" style="width: auto;float: right; padding: 0 10px;display:inline-block;">' + res.object.opName + '</h1></li>'
                                            $('#saveform').after($(optStr));
                                        } else {
                                            var optStr = '<li id="' + res.object.opId + '" class="rig_li opt_btn" style="width: 100% !important;" data-type="' + res.object.opId + '"><img src="/img/workflow/flowsetting/' + res.object.picName + '.png" style="margin:5px 9px;float:left"><h1 class="rig_h1" style="width: auto;display:inline-block;">' + res.object.opName + '</h1></li>'
                                            $('#associationOperation ul').append($(optStr));
                                        }
                                    }
                                }
                            });
                        }
                    }
                    if ($('#associationOperation ul').html() != '') {
                        $('#associationOperation').show()
                        var height = $('#associationOperation .floatRight1').height() + 10;
                        $('#associationOperation .floatRight1').css('top', '-' + height + 'px')
                    }
                }
            }
        }
        //判断工作交办人是否办理完毕
        function assignIsOver() {
            var isOver
            $.ajax({
                type: 'get',
                url: '/flowAssign/checkAssign',
                dataType: 'json',
                async:false,
                data: {
                    runId: runId,
                    prcsId:flowStep,
                    flowPrcs:prcsId
                },
                success:function (res) {
                    if(res.code==0){
                        isOver=res
                    }
                }
            })
            return isOver
        }
    });
    function clickDownload(e) {
        var url = e.attr('url');
        var file = url.split('ATTACHMENT_NAME=')[1]

        if(file.indexOf('&')>=0){
            file = file.split('&')[1]
            var attUrl = url.split('ATTACHMENT_NAME=')[0]+'ATTACHMENT_NAME=&'+file;
        }else{
            file = ''
            var attUrl = url.split('ATTACHMENT_NAME=')[0]+'ATTACHMENT_NAME=';
        }

        window.open(attUrl);
    };

    //返回一个字符在字符串中出现的次数
    function getShowTimes(string, indexChar) {
        var times = 0;
        try {
            if (!!string && !!indexChar) {
                times = (string.split(indexChar).length - 1);
            }
        } catch (e) {
            console.log(e);
        }
        return times;
    }

    function openPrcsUserLayer (userStr, userIds, eleId) {
        layer.open({
            title: '选择经办人',
            area: ['400px', '300px'],
            btn: ['确定', '取消'],
            content: '<div><div><textarea style="width: 100%;border-radius: 5px;box-sizing: border-box;margin: 0;" type="text" readonly id="prcsUser" rows="3"></textarea></div>' +
                    '<div><a href="javascript:;" class="add_prcs_user" style="text-decoration: none;color: blue;margin-right: 20px;">选择</a><a href="javascript:;" class="clear_prcs_user" style="text-decoration: none;color: red;">清空</a></div></div>',
            success: function() {
                $('#prcsUser').val(userStr || '')
                $('#prcsUser').attr('user_id', (userIds || ''))
                $('.add_prcs_user').on('click', function(){
                    user_id = 'prcsUser'
                    $.popWindow('/common/selectUser')
                })
                $('.clear_prcs_user').on('click', function(){
                    $('#prcsUser').val('')
                    $('#prcsUser').attr('user_id', '')
                })
            },
            yes: function(index) {
                var userName = $('#prcsUser').val()
                var userId = $('#prcsUser').attr('user_id')
                var iframeWindow = $('.cont_cthr').find('iframe').get(0).contentWindow
                iframeWindow.setPrcsUser(userName, userId, eleId);
                var $prcsEles = $(iframeWindow.document).find('.prcs_user')
                var text = ''
                $prcsEles.each(function(){
                    var prcsId = $(this).attr('id').split('_')[1]
                    var prcsUser = $(this).attr('userid')

                    if (prcsUser) {
                        var str = prcsId+':'+prcsUser
                        text += str + '|'
                    }
                })
                var data = {
                    text: text,
                    runId: runId
                }
                $.post('/flowRun/savePresetUser', data, function(res) {

                })
                layer.close(index)
            }
        })
    }
</script>
<script type="text/javascript">
    var TANGER_OCX_OBJ;
    function init() {
        TANGER_OCX_OBJ=document.getElementById("TANGER_OCX");
        TANGER_OCX_OBJ.activate(true);
        if(window.navigator.platform=="Win64"){
            TANGER_OCX_OBJ.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.0.2","../../lib/officecontrol/ntkooledocallx64.cab",51,true);
        }else{
            TANGER_OCX_OBJ.AddDocTypePlugin(".tif","tif.NtkoDocument","4.0.0.2","../../lib/officecontrol/ntkooledocall.cab",51,true);
            TANGER_OCX_OBJ.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.0.2","../../lib/officecontrol/ntkooledocall.cab",51,true);
        }
        TANGER_OCX_OBJ.CreateNew("word.document");
    };
    /*
     *  func 从本地附件套红功能filename='C:\Users\gsb\Desktop\test.dot'
     *  string filename 必选  本地模板的路径
     *  bool [PromptSelect] 是否允许用户选择
     *  bool [IsConfirmConversions] 当模板文件不是WORD类型时，是否提示转换，默认true
     * */
    function red_chromatography_local(){//套红
        //AddTemplateFromLocal(filename, [PromptSelect], [IsConfirmConversions]);
        var filename = 'test.dot';
        TANGER_OCX_OBJ.AddTemplateFromLocal(filename);//此处不能为空，必须带一个参数
    };
    /*
     *  func 从url套红功能
     *  string URL 必选  远程模板文件URL
     *  bool [IsConfirmConversions] 当模板文件不是WORD类型时，是否提示转换，默认true
     * */
    function red_chromatography_url(){//套红可用，加载服务器资源下的，路径如下
        //TANGER_OCX_OBJ.AddTemplateFromURL(URL,[IsConfirmConversions]);
        var URL='/file/pjc/test.dot';
        TANGER_OCX_OBJ.AddTemplateFromURL(URL);
    };

    /*
     * 强制进入或者退出保留痕迹
     * bool vbool 是否保留痕迹
     * */
    function EnterRevisionMode(id){
        var domID = document.getElementById(id);
        var vbool = domID.value;
        TANGER_OCX_OBJ.EnterRevisionMode(vbool);
    };
    /*
     * 该函数使用HTTP协议将文件保存到URL
     * string URL 处理后台保存的URL地址
     * String FileFieldName 控件文件域名称
     * string FileName 文件名
     * bool IsShowUI 是否显示进度条
     * return 提交URL之后从服务器返回的数据
     * */
    function SaveToURL(){
        TANGER_OCX_OBJ.SaveToURL("../../upload?module=email","file","","/file/pjc/test.dot","upload_file");
    };
    /*
     * string SaveAsDocument 保存到本地的文档路径 可选
     * bool OverwriteExisting 是否覆盖现文件 可选
     * bool isPrompt 是否提示用户选择 可选
     * */
    function SaveToLocal(){//可用
        var SaveAsDocument = 'D:/test1.doc';
        TANGER_OCX_OBJ.SaveToLocal(SaveAsDocument);
    };
    //打印功能
    function doc_print(){
        TANGER_OCX_OBJ.PrintPreview();
        TANGER_OCX_OBJ.PrintOut();
    };

</script>
<script src="/js/workflow/work/workformconnect.js?20201014.4"></script>
</html>
